1. 23 Jun, 2015 1 commit
    • Jason Rhinelander's avatar
      Removed Matrix layer in favour of just using Eigen · 247373eb
      Jason Rhinelander authored
      The Matrix layer worked, but is too slow (creativity default runs took
      about 2.5x as long with the Matrix layer).  It's also sort of a hassle:
      any new matrix features that are needed require adding new glue layer
      instead of just using Eigen as is.
      This means, however, that eris now requires Eigen to compile.
      This commit is basically the old creativity code, but with some minor
      cleanups to the restriction code, and a modification to use jacobiSvd
      for least-squares calculation (instead of using X'X.solve(X'y) with a
      QR solver).
  2. 22 Jun, 2015 5 commits
  3. 21 Jun, 2015 2 commits
    • Jason Rhinelander's avatar
      Various Matrix fixups needed in practice. · 9fce0da4
      Jason Rhinelander authored
      - Added virtual destructor (since Matrix is inherited by (Row)Vector)
      - Added new(Matrix|Vector|RowVector) methods that work just like the
        create/createVector/createRowVector methods, but return a pointer
        created with "new" rather than an object, so that objects being
        stored in unique_ptr or shared_ptr can be stored without requiring an
        extra move constructor.  In other words,
        `ptr.reset(new Matrix(whatever.create(...)))` can now be written
      - Added `offset` parameter to top/bottom/left/right methods.  This
        means they can now be used to access the central part of the matrix
        skipping the beginning (top/left) or ending (bottom/right)
        rows/columns.  Thus the equivalent of Eigen's .middleRows(r, n) can
        now be written as .top(n, r) instead of .block(r, 0, n, 0).  (It
        doesn't save much code, but the meaning is clearer).
      - Added the offset to the head/tail methods of row/column vectors as
        well, for an equivalent to Eigen's .segment method.
      - Added matrix resizing.
      - Added unary negative.
      - Allow matrix scaling by any numeric type, not just doubles.  Implicit
        conversion was causing a problem because a Matrix itself is also
        implicitly convertible to a double.
      - Added explicit multiplication by Vector and RowVector.  Without this,
        matrix multiplication by vectors was ambiguous: the multiplication
        could either be via implicit conversion to double, or via implicit
        upcasting to a Matrix.  The explicit RowVector/Vector arguments
        eliminates the ambiguity.
      - Added documentation to CoeffProxy.
      - Keep track of whether a matrix is a block so that we know when to
        throw on an attempted resize of a block view.
      - Declare Vector and RowVector final (it may help with optimization).
      - Made all methods protected (and declare Matrix a friend) to better
        get across the idea that these aren't mean to be called externally.
      - Added resize()
      - Made virtual override methods protected as in MatrixImpl.
      - Keep qr()/llt()/etc. public, moved to top.
    • Jason Rhinelander's avatar
      Added move workaround for Eigen < 3.3 · af1e7993
      Jason Rhinelander authored
      Eigen objects before 3.3 don't support moving--but they do,
      unfortunately, have implicit move constructors, but those implicit ones
      break things.  This workaround uses copying instead of moving for
      pre-3.3 Eigen versions.
      This commit also removes some debugging from EigenImpl.
  4. 19 Jun, 2015 2 commits
    • Jason Rhinelander's avatar
    • Jason Rhinelander's avatar
      Matrix interface; bump to 0.3.0 in CMakeLists · 1bfaeb0f
      Jason Rhinelander authored
      Added a matrix interface for use in Eris.  This interface is designed to
      be generic rather than tied to any specific matrix implementation, and
      only provides the functionality needed within eris; this commit includes
      an Eigen implementation.  This eigen implementation is entirely
      header-based, so that eris itself doesn't directly depend on Eigen.
      v0.3.0 will incorporate this as well as the linear Bayesian belief
      structure from creativity.
  5. 24 Apr, 2015 1 commit
    • Jason Rhinelander's avatar
      Added build instructions; minor build changes · 22a3ef1f
      Jason Rhinelander authored
      README now contains quick build instructions.
      Build now includes only the headers copied into build/include; the
      source dir is no longer included in the include list.
      Renamed cmake variable eris_include to eris_doc_include to better
      describe its purpose (and because I thought it wasn't being used,
      forgetting about the doc cmake).
  6. 02 Feb, 2015 4 commits
  7. 28 Jan, 2015 1 commit
    • Jason Rhinelander's avatar
      Added an interopt-Begin phase · da061356
      Jason Rhinelander authored
      It works essentially just like intraFinish(), but happens as the first
      thing in a run() call, whereas intraFinish() is the last thing in a
      run() call.
  8. 20 Jan, 2015 1 commit
    • Jason Rhinelander's avatar
      ERIS_DBG: failed for variables named 's', 't' · 727595c1
      Jason Rhinelander authored
      The DBG macros were using 's' for the ostringstream, and so
      ERIS_DBGVAR(s) would end up masking the desired s variable.  Renamed to
      internal ostringstream to _eris_debug_oss to avoid this clash.
      Similarly the TDBG macros declared t and tstr variables; also prefixed
      them with '_eris_debug_' to avoid potential clashes.
  9. 16 Jan, 2015 1 commit
    • Jason Rhinelander's avatar
      Random: rng() wasn't seeding after seed() · 388cfbcf
      Jason Rhinelander authored
      If Random::seed() was called before rng() had been called, the rng
      wouldn't be seeded at all (but the status flag would be set).  Fixed
      this: a call to seed() now actually seeds the current thread's rng.
      Bumped version for fix.
  10. 12 Jan, 2015 1 commit
  11. 11 Jan, 2015 3 commits
  12. 10 Jan, 2015 1 commit
  13. 07 Jan, 2015 3 commits
  14. 15 Dec, 2014 1 commit
  15. 12 Dec, 2014 3 commits
  16. 11 Dec, 2014 1 commit
  17. 10 Dec, 2014 1 commit
  18. 08 Dec, 2014 2 commits
    • Jason Rhinelander's avatar
      Random: provide N(0,1) object · f284c5e1
      Jason Rhinelander authored
      normal_distribution, in particular, benefits from being stored and
      reused (rather than having new objects as needed) because it generates
      values in pairs on every second call; not storing the object wastes
      half the random draws.
      This commit adds public Random::rstdnorm() to return a N(0,1), and
      Random::stdnorm access to directly invoke the underlying
    • Jason Rhinelander's avatar
      Reenable ..._SHLIBDEPS for .deb package · 01f5386d
      Jason Rhinelander authored
      Without it, the .deb has no dependencies at all; the dependencies on
      libc6 and libgcc1 aren't that important, but when built with
      clang++-libc++, not listing the added libc++1 dependency is a bigger
  19. 03 Dec, 2014 2 commits
    • Jason Rhinelander's avatar
      Made eris::Random::rng_t a noncopyable wrapper · c20cb94e
      Jason Rhinelander authored
      Previously it was simply a std::mt19937_64 typedef; now it's a
      noncopyable wrapper around that.  The point is to make sure the rng
      never gets copied (if you really want to copy it, you can, by casting
      to a mt19937_64 then copying), by statements like:
          auto rng = eris::Random::rng();
          // do things with rng
      (which is now forbidden) instead of:
          auto &rng = eris::Random::rng();
          // do things with rng
      (which is still allowed, and slightly more efficient when rng will be
      used many times, as the rng() call also has to check seeded_).
      Position::random was doing exactly this--and as a result,
      creativity::Reader, which multiplied a random Position by a random
      distance, was *always* moving to the right, since the first Position
      coefficient and the random distance were drawn from two different rng's
      with the same state.
    • Jason Rhinelander's avatar
      Added repeated-boundary constructors · d4d6195c
      Jason Rhinelander authored
      WrappedPositional<T> and Positional<T> can now be initialized with
      two numeric boundaries, which are used as the boundaries in all
      dimensions.  In other words:
      WrappedPositional<T>({1,2,3}, 3, -3)
      is now valid, and results in the same behaviour (i.e. wrapping in every
      dimension) as:
      WrappedPositional<T>({1,2,3}, {3,3,3}, {-3,-3,-3})
      (and likewise for Positional<T>)
  20. 21 Nov, 2014 1 commit
    • Jason Rhinelander's avatar
      Swapped spawn() and create() method names · 17dae7fc
      Jason Rhinelander authored
      Simulation::create() makes far more sense for creating a new simulation
      object than Simulation::spawn(), and sim->spawn<T>(...) makes far more
      sense for creating a new simulation member than sim->create<T>(...).
      Since the new names don't interfere with the old ones (because the
      add-a-member version has a required template argument, while
      the create-a-simulation-object method has no templates), the old
      versions can be left in place, and so are still there (simply
      forwarding to the new version) and are now marked deprecated.
      Bumped the version up to 0.2.3 to go along with this change.
  21. 15 Nov, 2014 3 commits