concepts.hpp 72 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576
  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