/* * Box.cpp * * Created on: Jun 30, 2010 * Author: crueger */ #include "Box.hpp" #include "Matrix.hpp" Box::Box() { M= new Matrix(); M->one(); Minv = new Matrix(); Minv->one(); } Box::Box(const Box& src){ M=new Matrix(*src.M); Minv = new Matrix(*src.Minv); } Box::~Box() { delete M; delete Minv; } const Matrix &Box::getM() const{ return *M; } const Matrix &Box::getMinv() const{ return *Minv; } void Box::setM(Matrix _M){ *M =_M; *Minv = M->invert(); } Box &Box::operator=(const Box &src){ if(&src!=this){ delete M; delete Minv; M = new Matrix(*src.M); Minv = new Matrix(*src.Minv); } return *this; } Box &Box::operator=(const Matrix &mat){ setM(mat); return *this; }