NCBI C++ ToolKit
njn_matrix.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef ALGO_BLAST_GUMBEL_PARAMS__INCLUDED_NJN_MATRIX
2 #define ALGO_BLAST_GUMBEL_PARAMS__INCLUDED_NJN_MATRIX
3 
4 /* $Id: njn_matrix.hpp 95054 2021-10-01 16:02:11Z merezhuk $
5 * ===========================================================================
6 *
7 * PUBLIC DOMAIN NOTICE
8 * National Center for Biotechnology Information
9 *
10 * This software/database is a "United States Government Work" under the
11 * terms of the United States Copyright Act. It was written as part of
12 * the author's offical duties as a United States Government employee and
13 * thus cannot be copyrighted. This software/database is freely available
14 * to the public for use. The National Library of Medicine and the U.S.
15 * Government have not placed any restriction on its use or reproduction.
16 *
17 * Although all reasonable efforts have been taken to ensure the accuracy
18 * and reliability of the software and data, the NLM and the U.S.
19 * Government do not and cannot warrant the performance or results that
20 * may be obtained by using this software or data. The NLM and the U.S.
21 * Government disclaim all warranties, express or implied, including
22 * warranties of performance, merchantability or fitness for any particular
23 * purpose.
24 *
25 * Please cite the author in any work or product based on this material.
26 *
27 * ===========================================================================*/
28 
29 /*****************************************************************************
30 
31 File name: njn_matrix.hpp
32 
33 Author: John Spouge
34 
35 Contents: Matrix routines
36 
37 ******************************************************************************/
38 
39 
40 #include <corelib/ncbitype.h>
41 #include <assert.h>
42 
43 #include "njn_approx.hpp"
44 #include "njn_doubletype.hpp"
45 #include "njn_ioutil.hpp"
46 #include "njn_vector.hpp"
47 
48 
50 BEGIN_SCOPE(blast)
51 
52 BEGIN_SCOPE(Njn)
53 
54 
55  template <typename T>
56  class Matrix {
57 
58  public:
59 
60  static inline Matrix <T> *matrix (size_t k_, size_t m_, size_t n_, T a_ = static_cast <T> (0));
61  // allocates & returns an a_-initialized pointer to k_ matrices of dimension m_ x n_
62  // to deallocate :
63  // delete [] matrix; matrix = 0;
64 
65  static inline bool approx (const Matrix <T> &x_, const Matrix <T> &y_, T eps_);
66  static inline bool relApprox (const Matrix <T> &x_, const Matrix <T> &y_, T eps_);
67  static inline bool absRelApprox (const Matrix <T> &x_, const Matrix <T> &y_, T tol_, T rtol_);
68  static inline bool isSymmetric (const Matrix <T> &x_);
69 
70  inline Matrix ();
71  inline Matrix (const Matrix &matrix_);
72  inline Matrix (size_t m_, size_t n_, const T *vector_); // assumes vector_ contains m_ * n_ elements
73  inline Matrix (size_t m_, size_t n_, T a_ = static_cast <T> (0)); // copies a_ into m_ x n_ matrix elements
74  virtual inline ~Matrix ();
75 
76  inline Matrix &operator= (const Matrix &matrix_);
77  virtual inline void *create (bool isCopy_ = false) const;
78  virtual inline void copy (size_t m_, size_t n_, const T *const *matrix_);
79  virtual inline void copy (size_t m_, size_t n_, const T *vector_); // assumes vector_ contains m_ * n_ elements
80  virtual inline void copy (size_t m_, size_t n_, T a_ = static_cast <T> (0)); // copies a_ into m_ x n_ matrix elements
81 
82  virtual inline operator bool () const;
83 
84  virtual inline std::ostream &out (std::ostream &ostr_) const;
85  virtual inline std::istream &in (std::istream &istr_);
86 
87  virtual inline Matrix &operator= (const T &a_); // copies a_ into all vector elements
88 
89  virtual inline T *operator [] (size_t i_); // i-th row
90  virtual inline const T *operator [] (size_t i_) const; // i-th row
91 
92  virtual inline T &setValue () {return d_value;} // pointer to a typical matrix value for input
93 
94  virtual inline size_t getM () const {return d_m;} // m
95  virtual inline size_t getN () const {return d_n;} // n
96  virtual inline const T *const *getMatrix () const {return d_matrix_p;} // the matrix
97  virtual inline const T getValue () const {return d_value;} // pointer to a typical matrix value for input
98 
99  private:
100 
101  size_t d_m; // m
102  size_t d_n; // n
103  T **d_matrix_p; // the matrix
104  T d_value; // pointer to a typical matrix value for input
105 
106  virtual inline void init (size_t m_, size_t n_);
107  virtual inline void free ();
108  };
109 
110 BEGIN_SCOPE(MatrixIO)
111 
112  // The following routines handle specialized I/O for Matrix.
113  // They require I/O for the underlying values to be available.
114 
116  // GENERAL : IoUtil sets the format
117  // SYMMETRIC : IO the upper half of the matrix after checking for symmetry
118 
119  Format getFormat (); // gets the format type
120 
121  void setFormat (Format format_); // sets the format type
122 
123  Format clearFormat (); // resets the format type to and returns default
124 
125 END_SCOPE(MatrixIO)
126 END_SCOPE(Njn)
127 
128 template <typename T>
129 bool operator== (const Njn::Matrix <T> &matrix_, const Njn::Matrix <T> &matrix0_);
130 
131 template <typename S, typename T>
132 void copy (Njn::Matrix <S> *matrix_, const Njn::Matrix <T> &matrix0_);
133 
134 template <typename T>
135 std::ostream &operator<< (std::ostream &ostr_, const Njn::Matrix <T> &matrix_);
136 
137 template <typename T>
138 std::istream &operator>> (std::istream &istr_, Njn::Matrix <T> &matrix_);
139 
140 inline std::ostream &operator << (std::ostream &ostr_, Njn::MatrixIO::Format format_);
141 inline std::istream &operator >> (std::istream &istr_, Njn::MatrixIO::Format format_);
142 
143 //
144 // There are no more declarations beyond this point.
145 //
146 
147 BEGIN_SCOPE(Njn)
148 
149  template <typename T>
150  Matrix <T> *Matrix <T>::matrix (size_t k_, size_t m_, size_t n_, T a_)
151  // allocates & returns an a_-initialized pointer to k_ matrices of dimension m_ x n_
152  // to deallocate :
153  // delete [] matrix; matrix = 0;
154  {
155  Matrix <T> *matrix = new Matrix <T> [k_];
156 
157  for (size_t i = 0; i < k_; i++)
158  matrix [i].copy (m_, n_, a_);
159 
160  return matrix;
161  }
162 
163  template <typename T>
164  bool Matrix <T>::approx (const Matrix <T> &x_, const Matrix <T> &y_, T eps_)
165  {
166  assert (x_.getM () == y_.getM ());
167  assert (x_.getN () == y_.getN ());
168 
169  for (size_t i = 0; i < x_.getM (); i++) {
170  for (size_t j = 0; j < x_.getN (); j++) {
171  if (! Approx::approx (x_ [i][j], y_ [i][j], eps_)) return false;
172  }
173  }
174 
175  return true;
176  }
177 
178  template <typename T>
179  bool Matrix <T>::relApprox (const Matrix <T> &x_, const Matrix <T> &y_, T eps_)
180  {
181  assert (x_.getM () == y_.getM ());
182  assert (x_.getN () == y_.getN ());
183 
184  for (size_t i = 0; i < x_.getM (); i++) {
185  for (size_t j = 0; j < x_.getN (); j++) {
186  if (! Approx::relApprox (x_ [i][j], y_ [i][j], eps_)) return false;
187  }
188  }
189 
190  return true;
191  }
192 
193  template <typename T>
194  bool Matrix <T>::absRelApprox (const Matrix <T> &x_, const Matrix <T> &y_, T tol_, T rtol_)
195  {
196  assert (x_.getM () == y_.getM ());
197  assert (x_.getN () == y_.getN ());
198 
199  for (size_t i = 0; i < x_.getM (); i++) {
200  for (size_t j = 0; j < x_.getN (); j++) {
201  if (! Approx::absRelApprox (x_ [i][j], y_ [i][j], tol_, rtol_)) return false;
202  }
203  }
204 
205  return true;
206  }
207 
208  template <typename T>
210  {
211  if (x_.getM () != x_.getN ()) return false;
212 
213  for (size_t i = 0; i < x_.getM (); i++) {
214  for (size_t j = 0; j < i; j++) {
215  if (x_ [i][j] != x_ [j][i]) return false;
216  }
217  }
218 
219  return true;
220  }
221 
222  template <typename T>
224  : d_m (0), d_n (0), d_matrix_p (0), d_value (0)
225  {}
226 
227  template <typename T>
228  Matrix <T>::Matrix (const Matrix &matrix_)
229  : d_m (0), d_n (0), d_matrix_p (0), d_value (0)
230  {
231  operator= (matrix_);
232  }
233 
234  template <typename T>
236  size_t m_, // m
237  size_t n_, // n
238  const T *vector_) // the matrix
239  : d_m (0), d_n (0), d_matrix_p (0), d_value (0)
240  {
241  copy (m_, n_, vector_);
242  }
243 
244  template <typename T>
246  size_t m_, // m
247  size_t n_, // n
248  T a_) // the matrix elements
249  : d_m (0), d_n (0), d_matrix_p (0), d_value (0)
250  {
251  copy (m_, n_, a_);
252  }
253 
254  template <typename T>
255  Matrix <T>::~Matrix () {free ();}
256 
257  template <typename T>
259  {
260  if (this != &matrix_)
261  {
262  copy (matrix_.getM (), matrix_.getN (), matrix_.getMatrix ());
263  this->setValue () = matrix_.getValue ();
264  }
265  return *this;
266  }
267 
268  template <typename T>
269  void *Matrix <T>::create (bool isCopy_) const
270  {
271  Matrix *matrix = new Matrix;
272  if (isCopy_) matrix->operator= (*this);
273  return matrix;
274  }
275 
276  template <typename T>
277  Matrix <T>::operator bool () const {return getM () > 0 && getN () > 0;}
278 
279  template <typename T>
280  std::ostream &Matrix <T>::out (std::ostream &ostr_) const
281  {
282  assert (ostr_);
283 
284  USING_SCOPE(Njn);
285  USING_SCOPE(Njn::IoUtil);
286 
287  size_t i = 0;
288  size_t j = 0;
289 
291  {
292  switch (IoUtil::getFormat ()) {
293 
294  case IoUtil::MACHINE :
295 
296  for (i = 0; i < getM (); i++) {
297 
298  if (i != 0) ostr_ << endl;
299 
300  for (size_t j = 0; j < getN (); j++) {
301 
302  if (j != 0) ostr_ << '\t';
303  ostr_ << getMatrix () [i][j];
304  }
305  }
306 
307  break;
308 
309  case IoUtil::HUMAN :
310  default :
311 
312  ostr_ << getM () << "\t! row dimension of matrix\n";
313  ostr_ << getN () << "\t! column dimension of matrix\n";
314 
315  for (i = 0; i < getM (); i++) {
316 
317  if (i != 0) ostr_ << "\t! matrix elements\n";
318 
319  for (j = 0; j < getN (); j++) {
320 
321  if (j != 0) ostr_ << '\t';
322  ostr_ << getMatrix () [i][j];
323  }
324  }
325 
326  ostr_ << "\t! matrix elements";
327 
328  break;
329  }
330  }
332  {
333  if (! isSymmetric (*this)) IoUtil::abort ("Matrix::out : matrix is not symmetric");
334 
335  for (i = 0; i < getM (); i++)
336  {
337  if (i != 0) ostr_ << endl;
338 
339  for (size_t j = i; j < getN (); j++)
340  {
341  if (j != i) ostr_ << '\t';
342  ostr_ << getMatrix () [i][j];
343  }
344  }
345  }
346  else IoUtil::abort ("Matrix::out : impossible MatrixIO::getFormat ()");
347 
350 
351  return ostr_;
352  }
353 
354  template <typename T>
355  std::istream &Matrix <T>::in (std::istream &istr_)
356  {
357  assert (istr_);
358 
359  USING_SCOPE(Njn);
360  USING_SCOPE(Njn::IoUtil);
361 
362  size_t i = 0;
363  size_t j = 0;
364  size_t k = 0;
365  size_t m = 0;
366  size_t n = 0;
367 
368  string s;
369  stringstream sstream;
370 
371  std::vector <T> v;
372  T value = this->getValue ();
373 
375  {
376  switch (IoUtil::getFormat ()) {
377 
378  case IoUtil::MACHINE :
379 
380  getline (istr_, s);
381  sstream.str ("");
382  sstream << s;
383 
384  while (sstream >> value) v.push_back (value);
385 
386  if (! sstream.eof ()) IoUtil::abort ("Njn::Matrix::in : bad value for the MACHINE");
387 
388  n = v.size ();
389  if (n == 0) IoUtil::abort ("Njn::Matrix::in : bad n for the MACHINE");
390 
391  while (istr_ >> value) v.push_back (value);
392  if (! sstream.eof ()) IoUtil::abort ("Njn::Matrix::in : bad value for the MACHINE");
393 
394  m = v.size () / n;
395  if (m * n != v.size ()) IoUtil::abort ("Njn::Matrix::in : rows for the MACHINE have different lengths.");
396 
397  if (m != this->getM () || n != this->getN ()) {
398 
399  this->free ();
400  this->init (m, n);
401  }
402 
403  for (i = 0; i < m; i++) {
404 
405  for (j = 0; j < n; j++) d_matrix_p [i][j] = v [k++];
406  }
407 
408  break;
409 
410  case IoUtil::HUMAN :
411  default :
412 
413  string s;
414  stringstream sstream;
415 
416  IoUtil::getLine (istr_, s);
417  sstream.str ("");
418  sstream.clear ();
419  sstream << s;
420  sstream >> m;
421  if (sstream.fail ()) IoUtil::abort ("Njn::Matrix::in : bad m");
422 
423  IoUtil::getLine (istr_, s);
424  sstream.str ("");
425  sstream.clear ();
426  sstream << s;
427  sstream >> n;
428  if (sstream.fail ()) IoUtil::abort ("Njn::Matrix::in : bad n");
429 
430  if (m != this->getM () || n != this->getN ()) {
431 
432  this->free ();
433  this->init (m, n);
434  }
435 
436  for (i = 0; i < this->getM (); i++) {
437 
438  sstream.str ("");
439  IoUtil::getLine (istr_, s);
440  sstream.clear ();
441  sstream << s;
442 
443  for (j = 0; j < this->getN (); j++) {
444 
445  sstream >> d_matrix_p [i][j];
446 
447  if (sstream.fail ()) {
448 
449  ostringstream sistream;
450  sistream << i;
451  ostringstream sjstream;
452  sjstream << j;
453  IoUtil::abort ("Njn::Matrix::in : bad d_matrix_p [" + sistream.str () + "][" + sjstream.str () + "]");
454  }
455  }
456  }
457 
458  break;
459  }
460  }
462  {
463  getline (istr_, s);
464  sstream.str (s);
465  sstream.clear ();
466 
467  while (sstream >> value)
468  {
469  v.push_back (value);
470  }
471  if (! sstream.eof ()) IoUtil::abort ("Njn::Matrix::in : bad value for the MatrixIO::SYMMETRIC");
472 
473  m = n = v.size ();
474  if (n == 0) IoUtil::abort ("Njn::Matrix::in : bad n for the MatrixIO::SYMMETRIC");
475 
476  while (istr_ >> value) v.push_back (value);
477  if (! istr_.eof ()) IoUtil::abort ("Njn::Matrix::in : bad value for the MatrixIO::SYMMETRIC");
478 
479 
480  if (m * (m + 1) / 2 != v.size ()) IoUtil::abort ("Njn::Matrix::in : rows for the MatrixIO::SYMMETRIC have incorrect lengths.");
481 
482  if (m != this->getM () || n != this->getN ()) {
483 
484  this->free ();
485  this->init (m, n);
486  }
487 
488  for (i = 0; i < m; i++)
489  {
490  for (j = 0; j < i; j++) d_matrix_p [i][j] = d_matrix_p [j][i];
491  for (j = i; j < n; j++) d_matrix_p [i][j] = v [k++];
492  }
493  }
494  else IoUtil::abort ("Matrix::in : impossible MatrixIO::getFormat ()");
495 
498 
499  return istr_;
500  }
501 
502  template <typename T>
504  {
505  copy (this->getM (), this->getN (), a_);
506  return *this;
507  }
508 
509  template <typename T>
510  T *Matrix <T>::operator [] (size_t i_)
511  {
512  return d_matrix_p [i_];
513  }
514 
515  template <typename T>
516  const T *Matrix <T>::operator [] (size_t i_) const
517  {
518  return d_matrix_p [i_];
519  }
520 
521  template <typename T>
523  size_t m_, // m
524  size_t n_, // n
525  const T *const *matrix_) // the matrix
526  {
527  if (m_ != this->getM () || n_ != this->getN ()) {
528  this->free ();
529  this->init (m_, n_);
530  }
531 
532  for (size_t i = 0; i < this->getM (); i++)
533  {
534  for (size_t j = 0; j < this->getN (); j++)
535  {
536  d_matrix_p [i][j] = matrix_ [i][j];
537  }
538  }
539  }
540 
541  template <typename T>
543  size_t m_, // m
544  size_t n_, // n
545  const T *vector_) // the matrix
546  {
547  if (m_ != this->getM () || n_ != this->getN ()) {
548  this->free ();
549  this->init (m_, n_);
550  }
551 
552  size_t k = 0;
553  for (size_t i = 0; i < this->getM (); i++)
554  {
555  for (size_t j = 0; j < this->getN (); j++)
556  {
557  d_matrix_p [i][j] = vector_ [k++];
558  }
559  }
560  }
561 
562  template <typename T>
564  size_t m_, // m
565  size_t n_, // n
566  T a_) // the matrix elements
567  {
568  if (m_ != this->getM () || n_ != this->getN ())
569  {
570  this->free ();
571  this->init (m_, n_);
572  }
573 
574  for (size_t i = 0; i < this->getM (); i++)
575  {
576  for (size_t j = 0; j < this->getN (); j++)
577  {
578  d_matrix_p [i][j] = a_;
579  }
580  }
581  }
582 
583  template <typename T>
584  void Matrix <T>::init (size_t m_, size_t n_)
585  {
586  if (m_ > 0) d_matrix_p = new T* [m_];
587 
588  for (size_t i = 0; i < m_; i++)
589  {
590  d_matrix_p [i] = new T [n_];
591  }
592 
593  d_m = m_;
594  d_n = n_;
595  }
596 
597  template <typename T>
599  {
600  for (size_t i = 0; i < this->getM (); i++) {
601  delete [] d_matrix_p [i]; d_matrix_p [i] = 0;
602  }
603  if (this->getM () > 0) delete [] d_matrix_p;
604  d_matrix_p = 0;
605 
606  d_m = 0;
607  d_n = 0;
608  }
609 
610 END_SCOPE(Njn)
611 
612 template <typename S, typename T>
613 void copy (Njn::Matrix <S> *matrix_, const Njn::Matrix <T> &matrix0_)
614 {
615  matrix_->copy (matrix0_.getM (), matrix0_.getN ());
616 
617  for (size_t i = 0; i < matrix0_.getM (); i++) {
618  for (size_t j = 0; j < matrix0_.getN (); j++) {
619  (*matrix_) [i][j] = static_cast <S> (matrix0_ [i][j]);
620  }
621  }
622 
623 }
624 
625 template <typename T>
626 bool operator== (const Njn::Matrix <T> &matrix_, const Njn::Matrix <T> &matrix0_)
627 {
628  if (matrix_.getM () != matrix0_.getM ()) return false;
629  if (matrix_.getN () != matrix0_.getN ()) return false;
630  for (size_t i = 0; i < matrix_.getM (); i++) {
631  for (size_t j = 0; j < matrix_.getN (); j++) {
632  if (matrix_.getMatrix () [i][j] != matrix0_.getMatrix () [i][j]) return false;
633  }
634  }
635 
636  return true;
637 }
638 
639 template <typename T>
640 std::ostream &operator<< (std::ostream &ostr_, const Njn::Matrix <T> &matrix_)
641 {return matrix_.out (ostr_);}
642 
643 template <typename T>
644 std::istream &operator>> (std::istream &istr_, Njn::Matrix <T> &matrix_)
645 {return matrix_.in (istr_);}
646 
647 std::ostream &operator << (std::ostream &ostr_, Njn::MatrixIO::Format format_)
648 {
649  Njn::MatrixIO::setFormat (format_);
650  return ostr_;
651 }
652 
653 std::istream &operator >> (std::istream &istr_, Njn::MatrixIO::Format format_)
654 {
655  Njn::MatrixIO::setFormat (format_);
656  return istr_;
657 }
658 
659 
660 END_SCOPE(blast)
662 
663 #endif //! ALGO_BLAST_GUMBEL_PARAMS__INCLUDED_NJN_MATRIX
664 
static bool absRelApprox(const Matrix< T > &x_, const Matrix< T > &y_, T tol_, T rtol_)
Definition: njn_matrix.hpp:194
virtual void * create(bool isCopy_=false) const
Definition: njn_matrix.hpp:269
size_t d_n
Definition: njn_matrix.hpp:102
virtual T * operator[](size_t i_)
Definition: njn_matrix.hpp:510
virtual const T getValue() const
Definition: njn_matrix.hpp:97
size_t d_m
Definition: njn_matrix.hpp:101
virtual size_t getN() const
Definition: njn_matrix.hpp:95
virtual const T *const * getMatrix() const
Definition: njn_matrix.hpp:96
T ** d_matrix_p
Definition: njn_matrix.hpp:103
static bool approx(const Matrix< T > &x_, const Matrix< T > &y_, T eps_)
Definition: njn_matrix.hpp:164
static bool relApprox(const Matrix< T > &x_, const Matrix< T > &y_, T eps_)
Definition: njn_matrix.hpp:179
virtual std::istream & in(std::istream &istr_)
Definition: njn_matrix.hpp:355
virtual T & setValue()
Definition: njn_matrix.hpp:92
virtual ~Matrix()
Definition: njn_matrix.hpp:255
virtual std::ostream & out(std::ostream &ostr_) const
Definition: njn_matrix.hpp:280
virtual void copy(size_t m_, size_t n_, const T *const *matrix_)
Definition: njn_matrix.hpp:522
static bool isSymmetric(const Matrix< T > &x_)
Definition: njn_matrix.hpp:209
Matrix & operator=(const Matrix &matrix_)
Definition: njn_matrix.hpp:258
static Matrix< T > * matrix(size_t k_, size_t m_, size_t n_, T a_=static_cast< T >(0))
Definition: njn_matrix.hpp:150
virtual void init(size_t m_, size_t n_)
Definition: njn_matrix.hpp:584
virtual void free()
Definition: njn_matrix.hpp:598
virtual size_t getM() const
Definition: njn_matrix.hpp:94
#define T(s)
Definition: common.h:230
#define S(s)
#define bool
Definition: bool.h:34
static void DLIST_NAME() init(DLIST_LIST_TYPE *list)
Definition: dlist.tmpl.h:40
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define USING_SCOPE(ns)
Use the specified namespace.
Definition: ncbistl.hpp:78
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
int i
yy_size_t n
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Defines Limits for the types used in NCBI C/C++ toolkit.
bool relApprox(T x_, T y_, T eps_)
Definition: njn_approx.hpp:74
bool approx(T x_, T y_, T eps_)
Definition: njn_approx.hpp:73
bool absRelApprox(T x_, T y_, T tol_, T rtol_)
Definition: njn_approx.hpp:75
std::istream & getLine(std::istream &in_, std::string &str_, const char t_=getTerminator())
Format
Definition: njn_ioutil.hpp:52
@ HUMAN
Definition: njn_ioutil.hpp:52
@ MACHINE
Definition: njn_ioutil.hpp:52
void abort()
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
Definition: njn_matrix.hpp:613
bool operator==(const Njn::Matrix< T > &matrix_, const Njn::Matrix< T > &matrix0_)
Definition: njn_matrix.hpp:626
std::istream & operator>>(std::istream &istr_, Njn::Matrix< T > &matrix_)
Definition: njn_matrix.hpp:644
void setFormat(Format format_)
std::ostream & operator<<(std::ostream &ostr_, const Njn::Matrix< T > &matrix_)
Definition: njn_matrix.hpp:640
Format clearFormat()
Format
Definition: njn_matrix.hpp:115
@ SYMMETRIC
Definition: njn_matrix.hpp:115
@ FORMAT
Definition: njn_matrix.hpp:115
@ GENERAL
Definition: njn_matrix.hpp:115
Format getFormat()
#define assert(x)
Definition: srv_diag.hpp:58
void free(voidpf ptr)
Modified on Fri Apr 26 16:24:00 2024 by modify_doxy.py rev. 669887