#include <flens/flens.cxx>
using namespace flens; using namespace std; int main() { typedef GbMatrix<BandStorage<double> > RealGbMatrix; typedef GeMatrix<FullStorage<double> > RealGeMatrix; typedef DenseVector<Array<double> > RealVector; RealGbMatrix A(5,5, 1, 1); RealVector x(5); A.diag( 0) = 3, 4, 5, 6, 7; A.diag( 1) = 8, 9, 1, 2; A.diag(-1) = -3, -4, -5, -6; x = 1, 2, 3, 4, 5; cout << "A = " << A << endl; cout << "x = " << x << endl; A += 2; cout << "A = " << A << endl; Underscore<int> _; RealGeMatrix B(3, 5, -1, 1); B(-1,_) = -1; B( 0,_) = 666; B( 1,_) = 1; typedef BandStorageView<double> BSV; RealGbMatrix::View A_ = BSV(5, 5, 1, 1, B.data(), B.leadingDimension()); cout << "A_ = " << A_ << endl; B += 2; cout << "A_ = " << A_ << endl; } |