Newmat C++ matrix library

Operating system: MacOS-10.14
Slicer version: 4.10.2


I’m trying to use newmat11 (Newmat C++ matrix library) library in my module, but a syntax error is found :slight_smile:

controlw.h:49:4: error: unknown type name ‘FREE_CHECK’

/// \ingroup newmat

/// \file controlw.h
/// Control word class.
/// Manipulate bits used for setting options.


/// Organise an int as a series of bits to set options.
/// \internal
class ControlWord
   int cw;                                      // the control word
   ControlWord() : cw(0) {}                     // do nothing
   ControlWord(int i) : cw(i) {}                // load an integer

      // select specific bits (for testing at least one set)
   ControlWord operator*(ControlWord i) const
      { return ControlWord(cw &; }
   void operator*=(ControlWord i)  { cw &=; }

      // set bits
   ControlWord operator+(ControlWord i) const
      { return ControlWord(cw |; }
   void operator+=(ControlWord i)  { cw |=; }

      // reset bits
   ControlWord operator-(ControlWord i) const
      { return ControlWord(cw - (cw &; }
   void operator-=(ControlWord i) { cw -= (cw &; }

      // check if all of selected bits set or reset
   bool operator>=(ControlWord i) const { return (cw & ==; }
   bool operator<=(ControlWord i) const { return (cw & == cw; }

      // flip selected bits
   ControlWord operator^(ControlWord i) const
      { return ControlWord(cw ^; }
   ControlWord operator~() const { return ControlWord(~cw); }

      // convert to integer
   int operator+() const { return cw; }
   int operator!() const { return cw==0; }



Any ideas on what’s going on and how to fix it?

Thanks for your help.

I don’t know much about the newmat library, but from a quick look at the homepage it looks pretty old and could be hard to support. Can’t you do what you need with numpy or vnl in itk? Those are already compiled on all platforms.

1 Like

Thank you for your answer. I will try replace it with bumpy or vnl.