concepts.hpp 72 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575
  1. //
  2. // Copyright (c) 2000-2002
  3. // Joerg Walter, Mathias Koch
  4. //
  5. // Distributed under the Boost Software License, Version 1.0. (See
  6. // accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // The authors gratefully acknowledge the support of
  10. // GeNeSys mbH & Co. KG in producing this work.
  11. //
  12. #ifndef _BOOST_UBLAS_CONCEPTS_
  13. #define _BOOST_UBLAS_CONCEPTS_
  14. #include <boost/concept_check.hpp>
  15. // Concept checks based on ideas of Jeremy Siek
  16. namespace boost { namespace numeric { namespace ublas {
  17. template<class I>
  18. struct Indexed1DIteratorConcept {
  19. typedef I iterator_type;
  20. void constraints () {
  21. iterator_type it = iterator_type ();
  22. // Index
  23. it.index ();
  24. }
  25. };
  26. template<class I>
  27. struct IndexedBidirectional1DIteratorConcept {
  28. typedef I iterator_type;
  29. void constraints () {
  30. function_requires< BidirectionalIteratorConcept<iterator_type> >();
  31. function_requires< Indexed1DIteratorConcept<iterator_type> >();
  32. }
  33. };
  34. template<class I>
  35. struct Mutable_IndexedBidirectional1DIteratorConcept {
  36. typedef I iterator_type;
  37. void constraints () {
  38. function_requires< Mutable_BidirectionalIteratorConcept<iterator_type> >();
  39. function_requires< Indexed1DIteratorConcept<iterator_type> >();
  40. }
  41. };
  42. template<class I>
  43. struct IndexedRandomAccess1DIteratorConcept {
  44. typedef I iterator_type;
  45. void constraints () {
  46. function_requires< RandomAccessIteratorConcept<iterator_type> >();
  47. function_requires< Indexed1DIteratorConcept<iterator_type> >();
  48. }
  49. };
  50. template<class I>
  51. struct Mutable_IndexedRandomAccess1DIteratorConcept {
  52. typedef I iterator_type;
  53. void constraints () {
  54. function_requires< Mutable_RandomAccessIteratorConcept<iterator_type> >();
  55. function_requires< Indexed1DIteratorConcept<iterator_type> >();
  56. }
  57. };
  58. template<class I>
  59. struct Indexed2DIteratorConcept {
  60. typedef I iterator_type;
  61. typedef typename I::dual_iterator_type dual_iterator_type;
  62. typedef typename I::dual_reverse_iterator_type dual_reverse_iterator_type;
  63. void constraints () {
  64. iterator_type it = iterator_type ();
  65. // Indices
  66. it.index1 ();
  67. it.index2 ();
  68. // Iterator begin/end
  69. dual_iterator_type it_begin (it.begin ());
  70. dual_iterator_type it_end (it.end ());
  71. // Reverse iterator begin/end
  72. dual_reverse_iterator_type it_rbegin (it.rbegin ());
  73. dual_reverse_iterator_type it_rend (it.rend ());
  74. ignore_unused_variable_warning (it_begin);
  75. ignore_unused_variable_warning (it_end);
  76. ignore_unused_variable_warning (it_rbegin);
  77. ignore_unused_variable_warning (it_rend);
  78. }
  79. };
  80. template<class I1, class I2>
  81. struct IndexedBidirectional2DIteratorConcept {
  82. typedef I1 subiterator1_type;
  83. typedef I2 subiterator2_type;
  84. void constraints () {
  85. function_requires< BidirectionalIteratorConcept<subiterator1_type> >();
  86. function_requires< BidirectionalIteratorConcept<subiterator2_type> >();
  87. function_requires< Indexed2DIteratorConcept<subiterator1_type> >();
  88. function_requires< Indexed2DIteratorConcept<subiterator2_type> >();
  89. }
  90. };
  91. template<class I1, class I2>
  92. struct Mutable_IndexedBidirectional2DIteratorConcept {
  93. typedef I1 subiterator1_type;
  94. typedef I2 subiterator2_type;
  95. void constraints () {
  96. function_requires< Mutable_BidirectionalIteratorConcept<subiterator1_type> >();
  97. function_requires< Mutable_BidirectionalIteratorConcept<subiterator2_type> >();
  98. function_requires< Indexed2DIteratorConcept<subiterator1_type> >();
  99. function_requires< Indexed2DIteratorConcept<subiterator2_type> >();
  100. }
  101. };
  102. template<class I1, class I2>
  103. struct IndexedRandomAccess2DIteratorConcept {
  104. typedef I1 subiterator1_type;
  105. typedef I2 subiterator2_type;
  106. void constraints () {
  107. function_requires< RandomAccessIteratorConcept<subiterator1_type> >();
  108. function_requires< RandomAccessIteratorConcept<subiterator2_type> >();
  109. function_requires< Indexed2DIteratorConcept<subiterator1_type> >();
  110. function_requires< Indexed2DIteratorConcept<subiterator2_type> >();
  111. }
  112. };
  113. template<class I1, class I2>
  114. struct Mutable_IndexedRandomAccess2DIteratorConcept {
  115. typedef I1 subiterator1_type;
  116. typedef I2 subiterator2_type;
  117. void constraints () {
  118. function_requires< Mutable_RandomAccessIteratorConcept<subiterator1_type> >();
  119. function_requires< Mutable_RandomAccessIteratorConcept<subiterator2_type> >();
  120. function_requires< Indexed2DIteratorConcept<subiterator1_type> >();
  121. function_requires< Indexed2DIteratorConcept<subiterator2_type> >();
  122. }
  123. };
  124. template<class C>
  125. struct StorageArrayConcept {
  126. typedef C container_type;
  127. typedef typename C::size_type size_type;
  128. typedef typename C::value_type value_type;
  129. void constraints () {
  130. function_requires< RandomAccessContainerConcept<container_type> >();
  131. size_type n (0);
  132. // Sizing constructor
  133. container_type c = container_type (n);
  134. // Initialised sizing constructor
  135. container_type (n, value_type (5));
  136. ignore_unused_variable_warning (c);
  137. }
  138. };
  139. template<class C>
  140. struct Mutable_StorageArrayConcept {
  141. typedef C container_type;
  142. typedef typename C::size_type size_type;
  143. typedef typename C::value_type value_type;
  144. typedef typename C::iterator iterator_type;
  145. void constraints () {
  146. function_requires< Mutable_RandomAccessContainerConcept<container_type> > ();
  147. size_type n (0);
  148. // Sizing constructor
  149. container_type c = container_type (n);
  150. // Initialised sizing constructor
  151. c = container_type (n, value_type (3));
  152. // Resize
  153. c.resize (n, value_type (5));
  154. // Resize - none preserving
  155. c.resize (n);
  156. }
  157. };
  158. template<class C>
  159. struct StorageSparseConcept {
  160. typedef C container_type;
  161. typedef typename C::size_type size_type;
  162. void constraints () {
  163. function_requires< ReversibleContainerConcept<container_type> > ();
  164. }
  165. };
  166. template<class C>
  167. struct Mutable_StorageSparseConcept {
  168. typedef C container_type;
  169. typedef typename C::size_type size_type;
  170. typedef typename C::value_type value_type;
  171. typedef typename C::iterator iterator_type;
  172. void constraints () {
  173. // NOTE - Not Mutable_ReversibleContainerConcept
  174. function_requires< ReversibleContainerConcept<container_type> >();
  175. container_type c = container_type ();
  176. value_type t = value_type ();
  177. iterator_type it = iterator_type (), it1 = iterator_type (), it2 = iterator_type ();
  178. // Insert
  179. c.insert (it, t);
  180. // Erase
  181. c.erase (it);
  182. // Range erase
  183. c.erase (it1, it2);
  184. // Clear
  185. c.clear ();
  186. }
  187. };
  188. template<class G>
  189. struct IndexSetConcept {
  190. typedef G generator_type;
  191. typedef typename G::size_type size_type;
  192. typedef typename G::value_type value_type;
  193. void constraints () {
  194. function_requires< AssignableConcept<generator_type> >();
  195. function_requires< ReversibleContainerConcept<generator_type> >();
  196. generator_type g = generator_type ();
  197. size_type n (0);
  198. value_type t;
  199. // Element access
  200. t = g (n);
  201. ignore_unused_variable_warning (t);
  202. }
  203. };
  204. /** \brief Scalar expression concept.
  205. *
  206. * requirements
  207. * \li \c SE::value_type is the type of the scalar expression
  208. * \li \c SE must be convertable to \c SE::value_type
  209. * \li the constant \c SE::complexity must exist
  210. *
  211. * \param SE the type of the scalar expression
  212. */
  213. template<class SE>
  214. struct ScalarExpressionConcept {
  215. typedef SE scalar_expression_type;
  216. typedef typename SE::value_type value_type;
  217. static const unsigned complexity = SE::complexity;
  218. void constraints () {
  219. scalar_expression_type *sp;
  220. scalar_expression_type s = *sp;
  221. value_type t;
  222. // Conversion
  223. t = s;
  224. ignore_unused_variable_warning (t);
  225. }
  226. };
  227. /** \brief Vector expression concept.
  228. *
  229. * requirements
  230. * \li \c VE::value_type is the type of the elements
  231. * \li \c VE::const_reference The return type when accessing an element of a constant vector
  232. * expression. Must be convertable to a \c value_type.
  233. * \li \c VE::size_type is the (unsigned) type of the indices
  234. * \li \c VE::difference_type is the (signed) type of distances between indices
  235. * \li \c VE::category
  236. *
  237. * \li the constant \c SE::complexity must exist
  238. *
  239. * \param SE the type of the scalar expression
  240. */
  241. template<class VE>
  242. struct VectorExpressionConcept {
  243. typedef VE vector_expression_type;
  244. typedef typename VE::type_category type_category;
  245. typedef typename VE::size_type size_type;
  246. typedef typename VE::difference_type difference_type;
  247. typedef typename VE::value_type value_type;
  248. typedef typename VE::const_reference const_reference;
  249. typedef typename VE::const_iterator const_iterator_type;
  250. typedef typename VE::const_reverse_iterator const_reverse_iterator_type;
  251. void constraints () {
  252. vector_expression_type *vp;
  253. const vector_expression_type *cvp;
  254. vector_expression_type v = *vp;
  255. const vector_expression_type cv = *cvp;
  256. size_type n (0), i (0);
  257. value_type t;
  258. // Find (internal?)
  259. const_iterator_type cit (v.find (i));
  260. // Beginning of range
  261. const_iterator_type cit_begin (v.begin ());
  262. // End of range
  263. const_iterator_type cit_end (v.end ());
  264. // Size
  265. n = v.size ();
  266. // Beginning of reverse range
  267. const_reverse_iterator_type crit_begin (cv.rbegin ());
  268. // End of reverse range
  269. const_reverse_iterator_type crit_end (cv.rend ());
  270. // Element access
  271. t = v (i);
  272. ignore_unused_variable_warning (n);
  273. ignore_unused_variable_warning (cit);
  274. ignore_unused_variable_warning (cit_begin);
  275. ignore_unused_variable_warning (cit_end);
  276. ignore_unused_variable_warning (crit_begin);
  277. ignore_unused_variable_warning (crit_end);
  278. ignore_unused_variable_warning (t);
  279. }
  280. };
  281. template<class VE>
  282. struct Mutable_VectorExpressionConcept {
  283. typedef VE vector_expression_type;
  284. typedef typename VE::size_type size_type;
  285. typedef typename VE::value_type value_type;
  286. typedef typename VE::iterator iterator_type;
  287. typedef typename VE::reverse_iterator reverse_iterator_type;
  288. void constraints () {
  289. function_requires< AssignableConcept<vector_expression_type> >();
  290. function_requires< VectorExpressionConcept<vector_expression_type> >();
  291. vector_expression_type *vp;
  292. vector_expression_type v = *vp, v1 = *vp, v2 = *vp;
  293. size_type i (0);
  294. value_type t = value_type ();
  295. // Find (internal?)
  296. iterator_type it (v.find (i));
  297. // Beginning of range
  298. iterator_type it_begin (v.begin ());
  299. // End of range
  300. iterator_type it_end (v.end ());
  301. // Swap
  302. v1.swap (v2);
  303. // Beginning of reverse range
  304. reverse_iterator_type rit_begin (v.rbegin ());
  305. // End of reverse range
  306. reverse_iterator_type rit_end (v.rend ());
  307. // Assignments
  308. v2 = v1;
  309. v2.assign (v1);
  310. v2 += v1;
  311. v2.plus_assign (v1);
  312. v2 -= v1;
  313. v2.minus_assign (v1);
  314. v *= t;
  315. ignore_unused_variable_warning (it);
  316. ignore_unused_variable_warning (it_begin);
  317. ignore_unused_variable_warning (it_end);
  318. ignore_unused_variable_warning (rit_begin);
  319. ignore_unused_variable_warning (rit_end);
  320. }
  321. };
  322. template<class ME>
  323. struct MatrixExpressionConcept {
  324. typedef ME matrix_expression_type;
  325. typedef typename ME::type_category type_category;
  326. typedef typename ME::size_type size_type;
  327. typedef typename ME::value_type value_type;
  328. typedef typename ME::const_iterator1 const_subiterator1_type;
  329. typedef typename ME::const_iterator2 const_subiterator2_type;
  330. typedef typename ME::const_reverse_iterator1 const_reverse_subiterator1_type;
  331. typedef typename ME::const_reverse_iterator2 const_reverse_subiterator2_type;
  332. void constraints () {
  333. matrix_expression_type *mp;
  334. const matrix_expression_type *cmp;
  335. matrix_expression_type m = *mp;
  336. const matrix_expression_type cm = *cmp;
  337. size_type n (0), i (0), j (0);
  338. value_type t;
  339. // Find (internal?)
  340. const_subiterator1_type cit1 (m.find1 (0, i, j));
  341. const_subiterator2_type cit2 (m.find2 (0, i, j));
  342. // Beginning of range
  343. const_subiterator1_type cit1_begin (m.begin1 ());
  344. const_subiterator2_type cit2_begin (m.begin2 ());
  345. // End of range
  346. const_subiterator1_type cit1_end (m.end1 ());
  347. const_subiterator2_type cit2_end (m.end2 ());
  348. // Size
  349. n = m.size1 ();
  350. n = m.size2 ();
  351. // Beginning of reverse range
  352. const_reverse_subiterator1_type crit1_begin (cm.rbegin1 ());
  353. const_reverse_subiterator2_type crit2_begin (cm.rbegin2 ());
  354. // End of reverse range
  355. const_reverse_subiterator1_type crit1_end (cm.rend1 ());
  356. const_reverse_subiterator2_type crit2_end (cm.rend2 ());
  357. // Element access
  358. t = m (i, j);
  359. ignore_unused_variable_warning (n);
  360. ignore_unused_variable_warning (cit1);
  361. ignore_unused_variable_warning (cit2);
  362. ignore_unused_variable_warning (cit1_begin);
  363. ignore_unused_variable_warning (cit2_begin);
  364. ignore_unused_variable_warning (cit1_end);
  365. ignore_unused_variable_warning (cit2_end);
  366. ignore_unused_variable_warning (crit1_begin);
  367. ignore_unused_variable_warning (crit2_begin);
  368. ignore_unused_variable_warning (crit1_end);
  369. ignore_unused_variable_warning (crit2_end);
  370. ignore_unused_variable_warning (t);
  371. }
  372. };
  373. template<class ME>
  374. struct Mutable_MatrixExpressionConcept {
  375. typedef ME matrix_expression_type;
  376. typedef typename ME::size_type size_type;
  377. typedef typename ME::value_type value_type;
  378. typedef typename ME::iterator1 subiterator1_type;
  379. typedef typename ME::iterator2 subiterator2_type;
  380. typedef typename ME::reverse_iterator1 reverse_subiterator1_type;
  381. typedef typename ME::reverse_iterator2 reverse_subiterator2_type;
  382. void constraints () {
  383. function_requires< AssignableConcept<matrix_expression_type> >();
  384. function_requires< MatrixExpressionConcept<matrix_expression_type> >();
  385. matrix_expression_type *mp;
  386. matrix_expression_type m = *mp, m1 = *mp, m2 = *mp;
  387. size_type i (0), j (0);
  388. value_type t = value_type ();
  389. // Find (internal?)
  390. subiterator1_type it1 (m.find1 (0, i, j));
  391. subiterator2_type it2 (m.find2 (0, i, j));
  392. // Beginning of range
  393. subiterator1_type it1_begin (m.begin1 ());
  394. subiterator2_type it2_begin (m.begin2 ());
  395. // End of range
  396. subiterator1_type it1_end (m.end1 ());
  397. subiterator2_type it2_end (m.end2 ());
  398. // Swap
  399. m1.swap (m2);
  400. // Beginning of reverse range
  401. reverse_subiterator1_type rit1_begin (m.rbegin1 ());
  402. reverse_subiterator2_type rit2_begin (m.rbegin2 ());
  403. // End of reverse range
  404. reverse_subiterator1_type rit1_end (m.rend1 ());
  405. reverse_subiterator2_type rit2_end (m.rend2 ());
  406. // Assignments
  407. m2 = m1;
  408. m2.assign (m1);
  409. m2 += m1;
  410. m2.plus_assign (m1);
  411. m2 -= m1;
  412. m2.minus_assign (m1);
  413. m *= t;
  414. ignore_unused_variable_warning (it1);
  415. ignore_unused_variable_warning (it2);
  416. ignore_unused_variable_warning (it1_begin);
  417. ignore_unused_variable_warning (it2_begin);
  418. ignore_unused_variable_warning (it1_end);
  419. ignore_unused_variable_warning (it2_end);
  420. ignore_unused_variable_warning (rit1_begin);
  421. ignore_unused_variable_warning (rit2_begin);
  422. ignore_unused_variable_warning (rit1_end);
  423. ignore_unused_variable_warning (rit2_end);
  424. }
  425. };
  426. template<class V>
  427. struct VectorConcept {
  428. typedef V vector_type;
  429. typedef typename V::size_type size_type;
  430. typedef typename V::value_type value_type;
  431. typedef const value_type *const_pointer;
  432. void constraints () {
  433. function_requires< VectorExpressionConcept<vector_type> >();
  434. size_type n (0);
  435. size_type i (0);
  436. // Sizing constructor
  437. vector_type v (n);
  438. // Element support
  439. const_pointer p = v.find_element (i);
  440. ignore_unused_variable_warning (p);
  441. }
  442. };
  443. template<class V>
  444. struct Mutable_VectorConcept {
  445. typedef V vector_type;
  446. typedef typename V::size_type size_type;
  447. typedef typename V::value_type value_type;
  448. typedef value_type *pointer;
  449. void constraints () {
  450. function_requires< VectorConcept<vector_type> >();
  451. function_requires< DefaultConstructible<vector_type> >();
  452. function_requires< Mutable_VectorExpressionConcept<vector_type> >();
  453. size_type n (0);
  454. value_type t = value_type ();
  455. size_type i (0);
  456. vector_type v;
  457. // Element support
  458. pointer p = v.find_element (i);
  459. // Element assignment
  460. value_type r = v.insert_element (i, t);
  461. v.insert_element (i, t) = r;
  462. // Zeroing
  463. v.clear ();
  464. // Resize
  465. v.resize (n);
  466. ignore_unused_variable_warning (p);
  467. ignore_unused_variable_warning (r);
  468. }
  469. };
  470. template<class V>
  471. struct SparseVectorConcept {
  472. typedef V vector_type;
  473. typedef typename V::size_type size_type;
  474. void constraints () {
  475. function_requires< VectorConcept<vector_type> >();
  476. }
  477. };
  478. template<class V>
  479. struct Mutable_SparseVectorConcept {
  480. typedef V vector_type;
  481. typedef typename V::size_type size_type;
  482. typedef typename V::value_type value_type;
  483. void constraints () {
  484. function_requires< SparseVectorConcept<vector_type> >();
  485. function_requires< Mutable_VectorConcept<vector_type> >();
  486. size_type i (0);
  487. vector_type v;
  488. // Element erasure
  489. v.erase_element (i);
  490. }
  491. };
  492. template<class M>
  493. struct MatrixConcept {
  494. typedef M matrix_type;
  495. typedef typename M::size_type size_type;
  496. typedef typename M::value_type value_type;
  497. typedef const value_type *const_pointer;
  498. void constraints () {
  499. function_requires< MatrixExpressionConcept<matrix_type> >();
  500. size_type n (0);
  501. size_type i (0), j (0);
  502. // Sizing constructor
  503. matrix_type m (n, n);
  504. // Element support
  505. #ifndef SKIP_BAD
  506. const_pointer p = m.find_element (i, j);
  507. #else
  508. const_pointer p;
  509. ignore_unused_variable_warning (i);
  510. ignore_unused_variable_warning (j);
  511. #endif
  512. ignore_unused_variable_warning (p);
  513. }
  514. };
  515. template<class M>
  516. struct Mutable_MatrixConcept {
  517. typedef M matrix_type;
  518. typedef typename M::size_type size_type;
  519. typedef typename M::value_type value_type;
  520. typedef value_type *pointer;
  521. void constraints () {
  522. function_requires< MatrixConcept<matrix_type> >();
  523. function_requires< DefaultConstructible<matrix_type> >();
  524. function_requires< Mutable_MatrixExpressionConcept<matrix_type> >();
  525. size_type n (0);
  526. value_type t = value_type ();
  527. size_type i (0), j (0);
  528. matrix_type m;
  529. // Element support
  530. #ifndef SKIP_BAD
  531. pointer p = m.find_element (i, j);
  532. ignore_unused_variable_warning (i);
  533. ignore_unused_variable_warning (j);
  534. #else
  535. pointer p;
  536. #endif
  537. // Element assigment
  538. value_type r = m.insert_element (i, j, t);
  539. m.insert_element (i, j, t) = r;
  540. // Zeroing
  541. m.clear ();
  542. // Resize
  543. m.resize (n, n);
  544. m.resize (n, n, false);
  545. ignore_unused_variable_warning (p);
  546. ignore_unused_variable_warning (r);
  547. }
  548. };
  549. template<class M>
  550. struct SparseMatrixConcept {
  551. typedef M matrix_type;
  552. typedef typename M::size_type size_type;
  553. void constraints () {
  554. function_requires< MatrixConcept<matrix_type> >();
  555. }
  556. };
  557. template<class M>
  558. struct Mutable_SparseMatrixConcept {
  559. typedef M matrix_type;
  560. typedef typename M::size_type size_type;
  561. typedef typename M::value_type value_type;
  562. void constraints () {
  563. function_requires< SparseMatrixConcept<matrix_type> >();
  564. function_requires< Mutable_MatrixConcept<matrix_type> >();
  565. size_type i (0), j (0);
  566. matrix_type m;
  567. // Elemnent erasure
  568. m.erase_element (i, j);
  569. }
  570. };
  571. /** introduce anonymous namespace to make following functions
  572. * local to the current compilation unit.
  573. */
  574. namespace {
  575. // Replaced the ZeroElement and OneElement functions with the templated versions
  576. // because the former where giving warnings with clang
  577. template<class T>
  578. T
  579. ZeroElement (T) {
  580. return T(0.0);
  581. }
  582. template<class T>
  583. vector<T>
  584. ZeroElement (vector<T>) {
  585. return zero_vector<T> ();
  586. }
  587. template<class T>
  588. matrix<T>
  589. ZeroElement (matrix<T>) {
  590. return zero_matrix<T> ();
  591. }
  592. template<class T>
  593. T
  594. OneElement (T) {
  595. return T(0.0);
  596. }
  597. template<class T>
  598. vector<T>
  599. OneElement (vector<T>) {
  600. return zero_vector<T> ();
  601. }
  602. template<class T>
  603. matrix<T>
  604. OneElement (matrix<T>) {
  605. return identity_matrix<T> ();
  606. }
  607. // template<>
  608. // float
  609. // ZeroElement (float) {
  610. // return 0.f;
  611. // }
  612. // template<>
  613. // double
  614. // ZeroElement (double) {
  615. // return 0.;
  616. // }
  617. // template<>
  618. // vector<float>
  619. // ZeroElement (vector<float>) {
  620. // return zero_vector<float> ();
  621. // }
  622. // template<>
  623. // vector<double>
  624. // ZeroElement (vector<double>) {
  625. // return zero_vector<double> ();
  626. // }
  627. // template<>
  628. // matrix<float>
  629. // ZeroElement (matrix<float>) {
  630. // return zero_matrix<float> ();
  631. // }
  632. // template<>
  633. // matrix<double>
  634. // ZeroElement (matrix<double>) {
  635. // return zero_matrix<double> ();
  636. // }
  637. // template<>
  638. // std::complex<float>
  639. // ZeroElement (std::complex<float>) {
  640. // return std::complex<float> (0.f);
  641. // }
  642. // template<>
  643. // std::complex<double>
  644. // ZeroElement (std::complex<double>) {
  645. // return std::complex<double> (0.);
  646. // }
  647. // template<>
  648. // vector<std::complex<float> >
  649. // ZeroElement (vector<std::complex<float> >) {
  650. // return zero_vector<std::complex<float> > ();
  651. // }
  652. // template<>
  653. // vector<std::complex<double> >
  654. // ZeroElement (vector<std::complex<double> >) {
  655. // return zero_vector<std::complex<double> > ();
  656. // }
  657. // template<>
  658. // matrix<std::complex<float> >
  659. // ZeroElement (matrix<std::complex<float> >) {
  660. // return zero_matrix<std::complex<float> > ();
  661. // }
  662. // template<>
  663. // matrix<std::complex<double> >
  664. // ZeroElement (matrix<std::complex<double> >) {
  665. // return zero_matrix<std::complex<double> > ();
  666. // }
  667. // template<class T>
  668. // T
  669. // OneElement (T);
  670. // template<>
  671. // float
  672. // OneElement (float) {
  673. // return 1.f;
  674. // }
  675. // template<>
  676. // double
  677. // OneElement (double) {
  678. // return 1.;
  679. // }
  680. // template<>
  681. // matrix<float>
  682. // OneElement (matrix<float>) {
  683. // return identity_matrix<float> ();
  684. // }
  685. // template<>
  686. // matrix<double>
  687. // OneElement (matrix<double>) {
  688. // return identity_matrix<double> ();
  689. // }
  690. // template<>
  691. // std::complex<float>
  692. // OneElement (std::complex<float>) {
  693. // return std::complex<float> (1.f);
  694. // }
  695. // template<>
  696. // std::complex<double>
  697. // OneElement (std::complex<double>) {
  698. // return std::complex<double> (1.);
  699. // }
  700. // template<>
  701. // matrix<std::complex<float> >
  702. // OneElement (matrix<std::complex<float> >) {
  703. // return identity_matrix<std::complex<float> > ();
  704. // }
  705. // template<>
  706. // matrix<std::complex<double> >
  707. // OneElement (matrix<std::complex<double> >) {
  708. // return identity_matrix<std::complex<double> > ();
  709. // }
  710. template<class E1, class E2>
  711. bool
  712. operator == (const vector_expression<E1> &e1, const vector_expression<E2> &e2) {
  713. typedef typename promote_traits<typename E1::value_type,
  714. typename E2::value_type>::promote_type value_type;
  715. typedef typename type_traits<value_type>::real_type real_type;
  716. return norm_inf (e1 - e2) == real_type/*zero*/();
  717. }
  718. template<class E1, class E2>
  719. bool
  720. operator == (const matrix_expression<E1> &e1, const matrix_expression<E2> &e2) {
  721. typedef typename promote_traits<typename E1::value_type,
  722. typename E2::value_type>::promote_type value_type;
  723. typedef typename type_traits<value_type>::real_type real_type;
  724. return norm_inf (e1 - e2) == real_type/*zero*/();
  725. }
  726. template<class T>
  727. struct AdditiveAbelianGroupConcept {
  728. typedef T value_type;
  729. void constraints () {
  730. bool r;
  731. value_type a = value_type (), b = value_type (), c = value_type ();
  732. r = (a + b) + c == a + (b + c);
  733. r = ZeroElement (value_type ()) + a == a;
  734. r = a + ZeroElement (value_type ()) == a;
  735. r = a + (- a) == ZeroElement (value_type ());
  736. r = (- a) + a == ZeroElement (value_type ());
  737. r = a + b == b + a;
  738. ignore_unused_variable_warning (r);
  739. }
  740. };
  741. template<class T>
  742. struct MultiplicativeAbelianGroupConcept {
  743. typedef T value_type;
  744. void constraints () {
  745. bool r;
  746. value_type a = value_type (), b = value_type (), c = value_type ();
  747. r = (a * b) * c == a * (b * c);
  748. r = OneElement (value_type ()) * a == a;
  749. r = a * OneElement (value_type ()) == a;
  750. r = a * (OneElement (value_type ()) / a) == a;
  751. r = (OneElement (value_type ()) / a) * a == a;
  752. r = a * b == b * a;
  753. ignore_unused_variable_warning (r);
  754. }
  755. };
  756. template<class T>
  757. struct RingWithIdentityConcept {
  758. typedef T value_type;
  759. void constraints () {
  760. function_requires< AdditiveAbelianGroupConcept<value_type> >();
  761. bool r;
  762. value_type a = value_type (), b = value_type (), c = value_type ();
  763. r = (a * b) * c == a * (b * c);
  764. r = (a + b) * c == a * c + b * c;
  765. r = OneElement (value_type ()) * a == a;
  766. r = a * OneElement (value_type ()) == a;
  767. ignore_unused_variable_warning (r);
  768. }
  769. };
  770. template<class T>
  771. struct Prod_RingWithIdentityConcept {
  772. typedef T value_type;
  773. void constraints () {
  774. function_requires< AdditiveAbelianGroupConcept<value_type> >();
  775. bool r;
  776. value_type a = value_type (), b = value_type (), c = value_type ();
  777. r = prod (T (prod (a, b)), c) == prod (a, T (prod (b, c)));
  778. r = prod (a + b, c) == prod (a, c) + prod (b, c);
  779. r = prod (OneElement (value_type ()), a) == a;
  780. r = prod (a, OneElement (value_type ())) == a;
  781. ignore_unused_variable_warning (r);
  782. }
  783. };
  784. template<class T>
  785. struct CommutativeRingWithIdentityConcept {
  786. typedef T value_type;
  787. void constraints () {
  788. function_requires< RingWithIdentityConcept<value_type> >();
  789. bool r;
  790. value_type a = value_type (), b = value_type ();
  791. r = a * b == b * a;
  792. ignore_unused_variable_warning (r);
  793. }
  794. };
  795. template<class T>
  796. struct FieldConcept {
  797. typedef T value_type;
  798. void constraints () {
  799. function_requires< CommutativeRingWithIdentityConcept<value_type> >();
  800. bool r;
  801. value_type a = value_type ();
  802. r = a == ZeroElement (value_type ()) || a * (OneElement (value_type ()) / a) == a;
  803. r = a == ZeroElement (value_type ()) || (OneElement (value_type ()) / a) * a == a;
  804. ignore_unused_variable_warning (r);
  805. }
  806. };
  807. template<class T, class V>
  808. struct VectorSpaceConcept {
  809. typedef T value_type;
  810. typedef V vector_type;
  811. void constraints () {
  812. function_requires< FieldConcept<value_type> >();
  813. function_requires< AdditiveAbelianGroupConcept<vector_type> >();
  814. bool r;
  815. value_type alpha = value_type (), beta = value_type ();
  816. vector_type a = vector_type (), b = vector_type ();
  817. r = alpha * (a + b) == alpha * a + alpha * b;
  818. r = (alpha + beta) * a == alpha * a + beta * a;
  819. r = (alpha * beta) * a == alpha * (beta * a);
  820. r = OneElement (value_type ()) * a == a;
  821. ignore_unused_variable_warning (r);
  822. }
  823. };
  824. template<class T, class V, class M>
  825. struct LinearOperatorConcept {
  826. typedef T value_type;
  827. typedef V vector_type;
  828. typedef M matrix_type;
  829. void constraints () {
  830. function_requires< VectorSpaceConcept<value_type, vector_type> >();
  831. bool r;
  832. value_type alpha = value_type (), beta = value_type ();
  833. vector_type a = vector_type (), b = vector_type ();
  834. matrix_type A = matrix_type ();
  835. r = prod (A, alpha * a + beta * b) == alpha * prod (A, a) + beta * prod (A, b);
  836. ignore_unused_variable_warning (r);
  837. }
  838. };
  839. inline void concept_checks () {
  840. // Allow tests to be group to keep down compiler storage requirement
  841. #ifdef INTERAL
  842. #define INTERNAL_STORAGE
  843. #define INTERNAL_VECTOR
  844. #define INTERNAL_MATRIX
  845. #define INTERNAL_SPECIAL
  846. #define INTERNAL_SPARSE
  847. #define INTERNAL_EXPRESSION
  848. #endif
  849. // TODO enable this for development
  850. // #define VIEW_CONCEPTS
  851. // Element value type for tests
  852. typedef float T;
  853. // Storage Array
  854. #if defined (INTERNAL_STORAGE) || defined (INTERNAL_STORAGE_DENSE)
  855. {
  856. typedef std::vector<T> container_model;
  857. function_requires< Mutable_StorageArrayConcept<container_model> >();
  858. function_requires< RandomAccessIteratorConcept<container_model::const_iterator> >();
  859. function_requires< Mutable_RandomAccessIteratorConcept<container_model::iterator> >();
  860. }
  861. {
  862. typedef bounded_array<T, 1> container_model;
  863. function_requires< Mutable_StorageArrayConcept<container_model> >();
  864. function_requires< RandomAccessIteratorConcept<container_model::const_iterator> >();
  865. function_requires< Mutable_RandomAccessIteratorConcept<container_model::iterator> >();
  866. }
  867. {
  868. typedef unbounded_array<T> container_model;
  869. function_requires< Mutable_StorageArrayConcept<container_model> >();
  870. function_requires< RandomAccessIteratorConcept<container_model::const_iterator> >();
  871. function_requires< Mutable_RandomAccessIteratorConcept<container_model::iterator> >();
  872. }
  873. /* FIXME array_adaptors are in progress
  874. {
  875. typedef array_adaptor<T> container_model;
  876. function_requires< Mutable_StorageArrayConcept<container_model> >();
  877. function_requires< RandomAccessIteratorConcept<container_model::const_iterator> >();
  878. function_requires< Mutable_RandomAccessIteratorConcept<container_model::iterator> >();
  879. }
  880. */
  881. {
  882. typedef range container_model;
  883. function_requires< IndexSetConcept<range> >();
  884. function_requires< RandomAccessIteratorConcept<range::const_iterator> >();
  885. }
  886. {
  887. typedef slice container_model;
  888. function_requires< IndexSetConcept<range> >();
  889. function_requires< RandomAccessIteratorConcept<range::const_iterator> >();
  890. }
  891. {
  892. typedef indirect_array<> container_model;
  893. function_requires< IndexSetConcept<range> >();
  894. function_requires< RandomAccessIteratorConcept<range::const_iterator> >();
  895. }
  896. #endif
  897. // Storage Sparse
  898. #if defined (INTERNAL_STORAGE) || defined (INTERNAL_STORAGE_SPARSE)
  899. {
  900. typedef map_array<std::size_t, T> container_model;
  901. function_requires< Mutable_StorageSparseConcept<container_model> >();
  902. function_requires< RandomAccessIteratorConcept<container_model::const_iterator> >();
  903. function_requires< RandomAccessIteratorConcept<container_model::iterator> >();
  904. }
  905. {
  906. typedef std::map<std::size_t, T> container_model;
  907. function_requires< Mutable_StorageSparseConcept<container_model > >();
  908. function_requires< BidirectionalIteratorConcept<container_model::const_iterator> >();
  909. function_requires< BidirectionalIteratorConcept<container_model::iterator> >();
  910. }
  911. #endif
  912. #ifdef VIEW_CONCEPTS
  913. // read only vectors
  914. {
  915. typedef vector_view<T> container_model;
  916. function_requires< RandomAccessContainerConcept<container_model> >();
  917. function_requires< VectorConcept<container_model> >();
  918. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  919. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  920. }
  921. #endif
  922. // Vector
  923. #if defined (INTERNAL_VECTOR) || defined (INTERNAL_VECTOR_DENSE)
  924. {
  925. typedef vector<T> container_model;
  926. function_requires< RandomAccessContainerConcept<container_model> >();
  927. function_requires< Mutable_VectorConcept<container_model> >();
  928. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  929. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  930. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  931. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  932. }
  933. {
  934. typedef zero_vector<T> container_model;
  935. function_requires< VectorConcept<container_model> >();
  936. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_iterator> >();
  937. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_reverse_iterator> >();
  938. }
  939. {
  940. typedef unit_vector<T> container_model;
  941. function_requires< VectorConcept<container_model> >();
  942. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_iterator> >();
  943. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_reverse_iterator> >();
  944. }
  945. {
  946. typedef scalar_vector<T> container_model;
  947. function_requires< VectorConcept<container_model> >();
  948. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  949. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  950. }
  951. {
  952. typedef c_vector<T, 1> container_model;
  953. function_requires< Mutable_VectorConcept<container_model> >();
  954. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  955. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  956. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  957. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  958. }
  959. #endif
  960. // Vector Proxies
  961. #if defined (INTERNAL_VECTOR) || defined (INTERNAL_VECTOR_PROXY)
  962. {
  963. typedef vector_range<vector<T> > container_model;
  964. function_requires< Mutable_VectorExpressionConcept<container_model> >();
  965. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  966. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  967. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  968. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  969. }
  970. {
  971. typedef vector_slice<vector<T> > container_model;
  972. function_requires< Mutable_VectorExpressionConcept<container_model> >();
  973. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  974. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  975. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  976. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  977. }
  978. {
  979. typedef vector_indirect<vector<T> > container_model;
  980. function_requires< Mutable_VectorExpressionConcept<container_model> >();
  981. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  982. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  983. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  984. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  985. }
  986. #endif
  987. // Sparse Vector
  988. #if defined (INTERNAL_SPARSE) || defined (INTERNAL_VECTOR_SPARSE)
  989. {
  990. typedef mapped_vector<T> container_model;
  991. function_requires< Mutable_SparseVectorConcept<container_model> >();
  992. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_iterator> >();
  993. function_requires< Mutable_IndexedBidirectional1DIteratorConcept<container_model::iterator> >();
  994. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_reverse_iterator> >();
  995. function_requires< Mutable_IndexedBidirectional1DIteratorConcept<container_model::reverse_iterator> >();
  996. }
  997. {
  998. typedef compressed_vector<T> container_model;
  999. function_requires< Mutable_SparseVectorConcept<container_model> >();
  1000. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_iterator> >();
  1001. function_requires< Mutable_IndexedBidirectional1DIteratorConcept<container_model::iterator> >();
  1002. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_reverse_iterator> >();
  1003. function_requires< Mutable_IndexedBidirectional1DIteratorConcept<container_model::reverse_iterator> >();
  1004. }
  1005. {
  1006. typedef coordinate_vector<T> container_model;
  1007. function_requires< Mutable_SparseVectorConcept<container_model> >();
  1008. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_iterator> >();
  1009. function_requires< Mutable_IndexedBidirectional1DIteratorConcept<container_model::iterator> >();
  1010. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_reverse_iterator> >();
  1011. function_requires< Mutable_IndexedBidirectional1DIteratorConcept<container_model::reverse_iterator> >();
  1012. }
  1013. #endif
  1014. // Matrix
  1015. #if defined (INTERNAL_MATRIX) || defined (INTERNAL_MATRIX_DENSE)
  1016. {
  1017. typedef matrix<T> container_model;
  1018. function_requires< Mutable_MatrixConcept<matrix<T> > >();
  1019. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1020. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1021. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1022. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1023. }
  1024. {
  1025. typedef vector_of_vector<T> container_model;
  1026. function_requires< Mutable_MatrixConcept<matrix<T> > >();
  1027. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1028. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1029. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1030. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1031. }
  1032. {
  1033. typedef zero_matrix<T> container_model;
  1034. function_requires< Mutable_MatrixConcept<matrix<T> > >();
  1035. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1036. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1037. }
  1038. {
  1039. typedef identity_matrix<T> container_model;
  1040. function_requires< Mutable_MatrixConcept<matrix<T> > >();
  1041. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1042. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1043. }
  1044. {
  1045. typedef scalar_matrix<T> container_model;
  1046. function_requires< Mutable_MatrixConcept<matrix<T> > >();
  1047. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1048. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1049. }
  1050. {
  1051. typedef c_matrix<T, 1, 1> container_model;
  1052. function_requires< Mutable_MatrixConcept<matrix<T> > >();
  1053. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1054. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1055. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1056. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1057. }
  1058. #endif
  1059. // Matrix Proxies
  1060. #if defined (INTERNAL_MATRIX) || defined (INTERNAL_MATRIX_PROXY)
  1061. {
  1062. typedef matrix_row<matrix<T> > container_model;
  1063. function_requires< Mutable_VectorExpressionConcept<container_model> >();
  1064. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  1065. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  1066. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  1067. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  1068. }
  1069. {
  1070. typedef matrix_column<matrix<T> > container_model;
  1071. function_requires< Mutable_VectorExpressionConcept<container_model> >();
  1072. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  1073. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  1074. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  1075. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  1076. }
  1077. {
  1078. typedef matrix_vector_range<matrix<T> > container_model;
  1079. function_requires< Mutable_VectorExpressionConcept<container_model> >();
  1080. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  1081. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  1082. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  1083. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  1084. }
  1085. {
  1086. typedef matrix_vector_slice<matrix<T> > container_model;
  1087. function_requires< Mutable_VectorExpressionConcept<container_model> >();
  1088. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  1089. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  1090. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  1091. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  1092. }
  1093. {
  1094. typedef matrix_vector_indirect<matrix<T> > container_model;
  1095. function_requires< Mutable_VectorExpressionConcept<container_model> >();
  1096. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  1097. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  1098. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  1099. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  1100. }
  1101. {
  1102. typedef matrix_range<matrix<T> > container_model;
  1103. function_requires< Mutable_MatrixExpressionConcept<container_model> >();
  1104. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1105. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1106. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1107. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1108. }
  1109. {
  1110. typedef matrix_slice<matrix<T> > container_model;
  1111. function_requires< Mutable_MatrixExpressionConcept<container_model> >();
  1112. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1113. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1114. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1115. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1116. }
  1117. {
  1118. typedef matrix_indirect<matrix<T> > container_model;
  1119. function_requires< Mutable_MatrixExpressionConcept<container_model> >();
  1120. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1121. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1122. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1123. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1124. }
  1125. #endif
  1126. // Banded Matrix
  1127. #if defined (INTERNAL_SPECIAL) || defined (INTERNAL_BANDED)
  1128. {
  1129. typedef banded_matrix<T> container_model;
  1130. function_requires< Mutable_MatrixConcept<container_model> >();
  1131. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1132. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1133. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1134. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1135. }
  1136. {
  1137. typedef banded_adaptor<matrix<T> > container_model;
  1138. function_requires< Mutable_MatrixExpressionConcept<container_model> >();
  1139. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1140. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1141. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1142. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1143. }
  1144. #endif
  1145. // Triangular Matrix
  1146. #if defined (INTERNAL_SPECIAL) || defined (INTERNAL_TRIANGULAR)
  1147. {
  1148. typedef triangular_matrix<T> container_model;
  1149. function_requires< Mutable_MatrixConcept<container_model> >();
  1150. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1151. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1152. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1153. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1154. }
  1155. {
  1156. typedef triangular_adaptor<matrix<T> > container_model;
  1157. function_requires< Mutable_MatrixExpressionConcept<container_model> >();
  1158. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1159. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1160. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1161. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1162. }
  1163. #endif
  1164. // Symmetric Matrix
  1165. #if defined (INTERNA_SPECIAL) || defined (INTERNAL_SYMMETRIC)
  1166. {
  1167. typedef symmetric_matrix<T> container_model;
  1168. function_requires< Mutable_MatrixConcept<container_model> >();
  1169. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1170. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1171. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1172. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1173. }
  1174. {
  1175. typedef banded_adaptor<matrix<T> > container_model;
  1176. #ifndef SKIP_BAD
  1177. // const_iterator (iterator) constructor is bad
  1178. function_requires< Mutable_MatrixExpressionConcept<container_model> >();
  1179. #endif
  1180. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1181. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1182. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1183. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1184. }
  1185. #endif
  1186. // Hermitian Matrix
  1187. #if defined (INTERNAL_SPECIAL) || defined (INTERNAL_HERMITIAN)
  1188. {
  1189. typedef hermitian_matrix<T> container_model;
  1190. function_requires< Mutable_MatrixConcept<container_model> >();
  1191. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1192. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1193. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1194. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1195. }
  1196. {
  1197. typedef hermitian_adaptor<matrix<T> > container_model;
  1198. #ifndef SKIP_BAD
  1199. // const_iterator (iterator) constructor is bad
  1200. function_requires< Mutable_MatrixExpressionConcept<container_model> >();
  1201. #endif
  1202. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1203. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1204. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1205. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1206. }
  1207. #endif
  1208. // Sparse Matrix
  1209. #if defined (INTERNAL_SPARSE) || defined (INTERNAL_MATRIX_SPARSE)
  1210. {
  1211. typedef mapped_matrix<T> container_model;
  1212. function_requires< Mutable_SparseMatrixConcept<container_model> >();
  1213. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1214. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1215. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1216. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1217. }
  1218. {
  1219. typedef mapped_vector_of_mapped_vector<T> container_model;
  1220. function_requires< Mutable_SparseMatrixConcept<container_model> >();
  1221. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1222. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1223. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1224. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1225. }
  1226. {
  1227. typedef compressed_matrix<T> container_model;
  1228. function_requires< Mutable_SparseMatrixConcept<container_model> >();
  1229. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1230. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1231. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1232. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1233. }
  1234. {
  1235. typedef coordinate_matrix<T> container_model;
  1236. function_requires< Mutable_SparseMatrixConcept<container_model> >();
  1237. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1238. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1239. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1240. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1241. }
  1242. {
  1243. typedef generalized_vector_of_vector<T, row_major, vector< coordinate_vector<T> > > container_model;
  1244. function_requires< Mutable_SparseMatrixConcept<container_model> >();
  1245. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1246. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1247. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1248. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1249. }
  1250. #endif
  1251. // Scalar Expressions
  1252. #if defined (INTERNAL_EXPRESSION) || defined (INTERNAL_VECTOR_EXPRESSION)
  1253. function_requires< ScalarExpressionConcept<scalar_value<T> > >();
  1254. function_requires< ScalarExpressionConcept<scalar_reference<T> > >();
  1255. // Vector Expressions
  1256. {
  1257. typedef vector_reference<vector<T> > expression_model;
  1258. function_requires< VectorExpressionConcept<expression_model> >();
  1259. function_requires< Mutable_VectorExpressionConcept<expression_model> >();
  1260. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
  1261. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<expression_model::iterator> >();
  1262. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
  1263. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<expression_model::reverse_iterator> >();
  1264. }
  1265. {
  1266. typedef vector_unary<vector<T>, scalar_identity<T> > expression_model;
  1267. function_requires< VectorExpressionConcept<expression_model> >();
  1268. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
  1269. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
  1270. }
  1271. {
  1272. typedef vector_binary<vector<T>, vector<T>, scalar_plus<T, T> > expression_model;
  1273. function_requires< VectorExpressionConcept<expression_model> >();
  1274. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
  1275. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
  1276. }
  1277. {
  1278. typedef vector_binary_scalar1<T, vector<T>, scalar_multiplies<T, T> > expression_model;
  1279. function_requires< VectorExpressionConcept<expression_model> >();
  1280. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
  1281. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
  1282. }
  1283. {
  1284. typedef vector_binary_scalar2<vector<T>, scalar_value<T>, scalar_multiplies<T, T> > expression_model;
  1285. function_requires< VectorExpressionConcept<expression_model> >();
  1286. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
  1287. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
  1288. }
  1289. {
  1290. typedef vector_binary_scalar1<scalar_value<T>, vector<T>, scalar_multiplies<T, T> > expression_model;
  1291. function_requires< VectorExpressionConcept<expression_model> >();
  1292. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
  1293. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
  1294. }
  1295. {
  1296. typedef vector_binary_scalar2<vector<T>, scalar_value<T>, scalar_multiplies<T, T> > expression_model;
  1297. function_requires< VectorExpressionConcept<expression_model> >();
  1298. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
  1299. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
  1300. }
  1301. function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_sum<vector<T> > > > >();
  1302. function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_norm_1<vector<T> > > > >();
  1303. function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_norm_2<vector<T> > > > >();
  1304. function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_norm_inf<vector<T> > > > >();
  1305. function_requires< ScalarExpressionConcept<vector_scalar_binary<vector<T>, vector<T>, vector_inner_prod<vector<T>, vector<T>, T> > > >();
  1306. #endif
  1307. // Matrix Expressions
  1308. #if defined (INTERNAL_EXPRESSION) || defined (INTERNAL_MATRIX_EXPRESSION)
  1309. {
  1310. typedef matrix_reference<matrix<T> > expression_model;
  1311. function_requires< MatrixExpressionConcept<expression_model> >();
  1312. function_requires< Mutable_MatrixExpressionConcept<expression_model> >();
  1313. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1314. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<expression_model::iterator1, expression_model::iterator2> >();
  1315. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1316. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<expression_model::reverse_iterator1, expression_model::reverse_iterator2> >();
  1317. }
  1318. {
  1319. typedef vector_matrix_binary<vector<T>, vector<T>, scalar_multiplies<T, T> > expression_model;
  1320. function_requires< MatrixExpressionConcept<expression_model> >();
  1321. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1322. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1323. }
  1324. {
  1325. typedef matrix_unary1<matrix<T>, scalar_identity<T> > expression_model;
  1326. function_requires< MatrixExpressionConcept<expression_model> >();
  1327. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1328. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1329. }
  1330. {
  1331. typedef matrix_unary2<matrix<T>, scalar_identity<T> > expression_model;
  1332. function_requires< MatrixExpressionConcept<expression_model> >();
  1333. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1334. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1335. }
  1336. {
  1337. typedef matrix_binary<matrix<T>, matrix<T>, scalar_plus<T, T> > expression_model;
  1338. function_requires< MatrixExpressionConcept<expression_model> >();
  1339. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1340. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1341. }
  1342. {
  1343. typedef matrix_binary_scalar1<T, matrix<T>, scalar_multiplies<T, T> > expression_model;
  1344. function_requires< MatrixExpressionConcept<expression_model> >();
  1345. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1346. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1347. }
  1348. {
  1349. typedef matrix_binary_scalar2<matrix<T>, T, scalar_multiplies<T, T> > expression_model;
  1350. function_requires< MatrixExpressionConcept<expression_model> >();
  1351. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1352. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1353. }
  1354. {
  1355. typedef matrix_binary_scalar1<scalar_value<T>, matrix<T>, scalar_multiplies<T, T> > expression_model;
  1356. function_requires< MatrixExpressionConcept<expression_model> >();
  1357. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1358. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1359. }
  1360. {
  1361. typedef matrix_binary_scalar2<matrix<T>, scalar_value<T>, scalar_multiplies<T, T> > expression_model;
  1362. function_requires< MatrixExpressionConcept<expression_model> >();
  1363. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1364. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1365. }
  1366. {
  1367. typedef matrix_vector_binary1<matrix<T>, vector<T>, matrix_vector_prod1<matrix<T>, vector<T>, T> > expression_model;
  1368. function_requires< VectorExpressionConcept<expression_model> >();
  1369. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
  1370. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
  1371. }
  1372. {
  1373. typedef matrix_vector_binary2<vector<T>, matrix<T>, matrix_vector_prod2<matrix<T>, vector<T>, T > > expression_model;
  1374. function_requires< VectorExpressionConcept<expression_model> >();
  1375. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
  1376. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
  1377. }
  1378. {
  1379. typedef matrix_matrix_binary<matrix<T>, matrix<T>, matrix_matrix_prod<matrix<T>, matrix<T>, T > > expression_model;
  1380. function_requires< MatrixExpressionConcept<expression_model> >();
  1381. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1382. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1383. }
  1384. function_requires< ScalarExpressionConcept<matrix_scalar_unary<matrix<T>, matrix_norm_1<vector<T> > > > >();
  1385. function_requires< ScalarExpressionConcept<matrix_scalar_unary<matrix<T>, matrix_norm_frobenius<vector<T> > > > >();
  1386. function_requires< ScalarExpressionConcept<matrix_scalar_unary<matrix<T>, matrix_norm_inf<vector<T> > > > >();
  1387. #endif
  1388. #ifdef EXTERNAL
  1389. function_requires< AdditiveAbelianGroupConcept<T> >();
  1390. function_requires< CommutativeRingWithIdentityConcept<T> >();
  1391. function_requires< FieldConcept<T> >();
  1392. function_requires< VectorSpaceConcept<T, vector<T> > >();
  1393. function_requires< Prod_RingWithIdentityConcept<matrix<T> > >();
  1394. function_requires< VectorSpaceConcept<T, matrix<T> > >();
  1395. function_requires< LinearOperatorConcept<T, vector<T>, matrix<T> > >();
  1396. function_requires< AdditiveAbelianGroupConcept<std::complex<T> > >();
  1397. function_requires< CommutativeRingWithIdentityConcept<std::complex<T> > >();
  1398. function_requires< FieldConcept<std::complex<T> > >();
  1399. function_requires< VectorSpaceConcept<std::complex<T>, vector<std::complex<T> > > >();
  1400. function_requires< Prod_RingWithIdentityConcept<matrix<std::complex<T> > > >();
  1401. function_requires< VectorSpaceConcept<std::complex<T>, matrix<std::complex<T> > > >();
  1402. function_requires< LinearOperatorConcept<std::complex<T>, vector<std::complex<T> >, matrix<std::complex<T> > > >();
  1403. #endif
  1404. }
  1405. } // end of anonymous namespace
  1406. }}}
  1407. #endif