OrderedSparseMatrix.h
Go to the documentation of this file.
00001 
00028 #pragma once
00029 
00030 #include "SparseVector.h"
00031 #include "SparseMatrix.h"
00032 
00033 #include <string>
00034 #include <fstream>
00035 #include <iostream>
00036 
00037 namespace isam {
00038 
00039 class OrderedSparseMatrix : public SparseMatrix {
00040   int* _r_to_a; // column variable order
00041   int* _a_to_r;
00042 
00047   void _allocate_OrderedSparseMatrix(bool init_order = true);
00048 
00053   void _copy_from_OrderedSparseMatrix(const OrderedSparseMatrix& mat);
00054 
00058   void _dealloc_OrderedSparseMatrix();
00059 
00066   void _calc_reverse_order(int num, const int* order, int* reverse_order) const;
00067 
00072   void _set_order(const int* r_to_a);
00073 
00074 public:
00075 
00081   OrderedSparseMatrix(int num_rows, int num_cols);
00082 
00087   OrderedSparseMatrix(const OrderedSparseMatrix& mat);
00088 
00097   OrderedSparseMatrix(const OrderedSparseMatrix& mat, int num_rows,
00098       int num_cols, int first_row = 0, int first_col = 0);
00099 
00100   OrderedSparseMatrix(int num_rows, int num_cols, SparseVector_p* rows);
00101 
00105   virtual ~OrderedSparseMatrix();
00106 
00112   const OrderedSparseMatrix& operator= (const OrderedSparseMatrix& mat);
00113 
00114   // overridden functions
00115 
00121   void set_row(int row, const SparseVector& new_row);
00122 
00130   void import_rows_ordered(int num_rows, int num_cols, SparseVector_p* rows, int* r_to_a);
00131 
00136   void append_new_cols(int num);
00137 
00138   // new functions
00139 
00145   virtual const int* a_to_r() const;
00146 
00152   virtual const int* r_to_a() const;
00153 
00154 };
00155 
00156 }


demo_rgbd
Author(s): Ji Zhang
autogenerated on Mon Jan 6 2014 11:16:08