Blender V2.61 - r43446
|
00001 00004 /* 00005 00006 * 00007 * Template Numerical Toolkit (TNT): Linear Algebra Module 00008 * 00009 * Mathematical and Computational Sciences Division 00010 * National Institute of Technology, 00011 * Gaithersburg, MD USA 00012 * 00013 * 00014 * This software was developed at the National Institute of Standards and 00015 * Technology (NIST) by employees of the Federal Government in the course 00016 * of their official duties. Pursuant to title 17 Section 105 of the 00017 * United States Code, this software is not subject to copyright protection 00018 * and is in the public domain. The Template Numerical Toolkit (TNT) is 00019 * an experimental system. NIST assumes no responsibility whatsoever for 00020 * its use by other parties, and makes no guarantees, expressed or implied, 00021 * about its quality, reliability, or any other characteristic. 00022 * 00023 * BETA VERSION INCOMPLETE AND SUBJECT TO CHANGE 00024 * see http://math.nist.gov/tnt for latest updates. 00025 * 00026 */ 00027 00028 // The requirements for a bare-bones vector class: 00029 // 00030 // 00031 // o) must have 0-based [] indexing for const and 00032 // non-const objects (i.e. operator[] defined) 00033 // 00034 // o) must have size() method to denote the number of 00035 // elements 00036 // o) must clean up after itself when destructed 00037 // (i.e. no memory leaks) 00038 // 00039 // -) must have begin() and end() methods (The begin() 00040 // method is necessary, because relying on 00041 // &v_[0] may not work on a empty vector (i.e. v_ is NULL.) 00042 // 00043 // o) must be templated 00044 // o) must have X::value_type defined to be the types of elements 00045 // o) must have X::X(const &x) copy constructor (by *value*) 00046 // o) must have X::X(int N) constructor to N-length vector 00047 // (NOTE: this constructor need *NOT* initalize elements) 00048 // 00049 // -) must have X::X(int N, T scalar) constructor to initalize 00050 // elements to value of "scalar". 00051 // 00052 // ( removed, because valarray<> class uses (scalar, N) rather 00053 // than (N, scalar) ) 00054 // -) must have X::X(int N, const T* scalars) constructor to copy from 00055 // any C linear array 00056 // 00057 // ( removed, because of same reverse order of valarray<> ) 00058 // 00059 // o) must have assignment A=B, by value 00060 // 00061 // NOTE: this class is *NOT* meant to be derived from, 00062 // so its methods (particularly indexing) need not be 00063 // declared virtual. 00064 // 00065 // 00066 // Some things it *DOES NOT* need to do are 00067 // 00068 // o) bounds checking 00069 // o) array referencing (e.g. reference counting) 00070 // o) support () indexing 00071 // o) I/O 00072 // 00073