lsst.jointcal  master-g9041cab851+10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Tripletlist.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 #ifndef LSST_JOINTCAL_TRIPLETLIST_H
3 #define LSST_JOINTCAL_TRIPLETLIST_H
4 
5 #include "Eigen/Sparse"
6 
7 #include <vector>
8 
9 namespace lsst {
10 namespace jointcal {
11 
12 typedef Eigen::Triplet<double> Trip;
13 
14 // at the moment this class implements the eigen format.
15 // it would be wise to implement it differently if talking to cholmod
16 class TripletList : public std::vector<Trip> {
17 private:
18  unsigned _nextFreeIndex;
19 
20 public:
21  TripletList(int count) : _nextFreeIndex(0) { reserve(count); };
22 
23  void addTriplet(const unsigned i, const unsigned j, double val) { push_back(Trip(i, j, val)); }
24 
25  unsigned getNextFreeIndex() const { return _nextFreeIndex; }
26 
27  void setNextFreeIndex(unsigned index) { _nextFreeIndex = index; }
28 };
29 } // namespace jointcal
30 } // namespace lsst
31 
32 #endif // LSST_JOINTCAL_TRIPLETLIST_H
void addTriplet(const unsigned i, const unsigned j, double val)
Definition: Tripletlist.h:23
unsigned getNextFreeIndex() const
Definition: Tripletlist.h:25
void setNextFreeIndex(unsigned index)
Definition: Tripletlist.h:27
Eigen::Triplet< double > Trip
Definition: Tripletlist.h:12