Prev Next scalar.cpp Headings

Convert Matrix to Scalar Source Code
 
# include <mat2cpp.hpp>
# include <cassert>
namespace mat2cpp {
     double scalar 
     (const matrix<double> &x)
     {    assert( x.size1() * x.size2() == 1 );
          double y = x(0, 0);
          return y;
     }
}

Input File: lib/scalar.cpp