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