/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */ /* $Id: vctFixedSizeMatrixTraits.h,v 1.9 2007/04/26 19:33:58 anton Exp $ Author(s): Ofri Sadowsky Created on: 2003-11-04 (C) Copyright 2003-2007 Johns Hopkins University (JHU), All Rights Reserved. --- begin cisst license - do not edit --- This software is provided "as is" under an open source license, with no warranty. The complete license can be found in license.txt and http://www.cisst.org/cisst/license.txt. --- end cisst license --- */ /*! \file \brief Declaration of vctFixedSizeMatrixTraits */ #ifndef _vctFixedSizeMatrixTraits_h #define _vctFixedSizeMatrixTraits_h #include /*! \brief Define common container related types based on the properties of a fixed size container. The types are declared according to the STL requirements for the types declared by a container object. This class is used as a trait to declare the actual containers. In addition to the STL required types, we declare a few more types for completeness. */ template class vctFixedSizeMatrixTraits { public: /* define most types from vctContainerTraits */ VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType); /*! Iterator, follows the STL naming convention. */ typedef vctFixedStrideMatrixIterator<_elementType, _colStride, _cols, _rowStride> iterator; /*! Const iterator, follows the STL naming convention. */ typedef vctFixedStrideMatrixConstIterator<_elementType, _colStride, _cols, _rowStride> const_iterator; /*! Reverse iterator, follows the STL naming convention. */ typedef vctFixedStrideMatrixIterator<_elementType, -_colStride, _cols, -_rowStride> reverse_iterator; /*! Const reverse iterator, follows the STL naming convention. */ typedef vctFixedStrideMatrixConstIterator<_elementType, -_colStride, _cols, -_rowStride> const_reverse_iterator; /*! Define the dimensions of the matrix: number of rows, number of columns, and the total length of the matrix, which is their product */ enum {ROWS = _rows, COLS = _cols, LENGTH = ROWS*COLS}; /*! Declared for completeness. */ typedef value_type array[LENGTH]; /*! Declared for completeness. */ typedef const value_type const_array[LENGTH]; /*! Declared to enable inference of the stride of the container. */ enum {ROWSTRIDE = _rowStride, COLSTRIDE = _colStride}; }; #endif // **************************************************************************** // Change History // **************************************************************************** // // $Log: vctFixedSizeMatrixTraits.h,v $ // Revision 1.9 2007/04/26 19:33:58 anton // All files in libraries: Applied new license text, separate copyright and // updated dates, added standard header where missing. // // Revision 1.8 2006/11/20 20:33:20 anton // Licensing: Applied new license to cisstCommon, cisstVector, cisstNumerical, // cisstInteractive, cisstImage and cisstOSAbstraction. // // Revision 1.7 2005/09/26 15:41:47 anton // cisst: Added modelines for emacs and vi. // // Revision 1.6 2005/05/19 19:29:01 anton // cisst libs: Added the license to cisstCommon and cisstVector // // Revision 1.5 2004/11/11 20:35:46 anton // cisstVector: *: Added a vctContainerTraits to centralize the declarations // of size_type, difference_type, reference, const_reference, etc. *: All // iterators are now derived from std::iterator. *: Added some missing typedef // for iterators. // // Revision 1.4 2004/10/25 13:52:05 anton // Doxygen documentation: Cleanup all the useless \ingroup. // // Revision 1.3 2004/09/03 19:56:36 anton // Doxygen documentation. // // Revision 1.2 2004/07/02 16:16:45 anton // Massive renaming in cisstVector for the addition of dynamic size vectors // and matrices. The dynamic vectors are far from ready. // // Revision 1.1 2003/11/04 21:58:49 ofri // Committing initial version of the code for fixed-size matrices. Need to // implement more operations and improve documentation, but the basic // framework works. // // ****************************************************************************