concepts.hpp 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540
  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. template<class T>
  576. T
  577. ZeroElement (T);
  578. template<>
  579. float
  580. ZeroElement (float) {
  581. return 0.f;
  582. }
  583. template<>
  584. double
  585. ZeroElement (double) {
  586. return 0.;
  587. }
  588. template<>
  589. vector<float>
  590. ZeroElement (vector<float>) {
  591. return zero_vector<float> ();
  592. }
  593. template<>
  594. vector<double>
  595. ZeroElement (vector<double>) {
  596. return zero_vector<double> ();
  597. }
  598. template<>
  599. matrix<float>
  600. ZeroElement (matrix<float>) {
  601. return zero_matrix<float> ();
  602. }
  603. template<>
  604. matrix<double>
  605. ZeroElement (matrix<double>) {
  606. return zero_matrix<double> ();
  607. }
  608. template<>
  609. std::complex<float>
  610. ZeroElement (std::complex<float>) {
  611. return std::complex<float> (0.f);
  612. }
  613. template<>
  614. std::complex<double>
  615. ZeroElement (std::complex<double>) {
  616. return std::complex<double> (0.);
  617. }
  618. template<>
  619. vector<std::complex<float> >
  620. ZeroElement (vector<std::complex<float> >) {
  621. return zero_vector<std::complex<float> > ();
  622. }
  623. template<>
  624. vector<std::complex<double> >
  625. ZeroElement (vector<std::complex<double> >) {
  626. return zero_vector<std::complex<double> > ();
  627. }
  628. template<>
  629. matrix<std::complex<float> >
  630. ZeroElement (matrix<std::complex<float> >) {
  631. return zero_matrix<std::complex<float> > ();
  632. }
  633. template<>
  634. matrix<std::complex<double> >
  635. ZeroElement (matrix<std::complex<double> >) {
  636. return zero_matrix<std::complex<double> > ();
  637. }
  638. template<class T>
  639. T
  640. OneElement (T);
  641. template<>
  642. float
  643. OneElement (float) {
  644. return 1.f;
  645. }
  646. template<>
  647. double
  648. OneElement (double) {
  649. return 1.;
  650. }
  651. template<>
  652. matrix<float>
  653. OneElement (matrix<float>) {
  654. return identity_matrix<float> ();
  655. }
  656. template<>
  657. matrix<double>
  658. OneElement (matrix<double>) {
  659. return identity_matrix<double> ();
  660. }
  661. template<>
  662. std::complex<float>
  663. OneElement (std::complex<float>) {
  664. return std::complex<float> (1.f);
  665. }
  666. template<>
  667. std::complex<double>
  668. OneElement (std::complex<double>) {
  669. return std::complex<double> (1.);
  670. }
  671. template<>
  672. matrix<std::complex<float> >
  673. OneElement (matrix<std::complex<float> >) {
  674. return identity_matrix<std::complex<float> > ();
  675. }
  676. template<>
  677. matrix<std::complex<double> >
  678. OneElement (matrix<std::complex<double> >) {
  679. return identity_matrix<std::complex<double> > ();
  680. }
  681. template<class E1, class E2>
  682. bool
  683. operator == (const vector_expression<E1> &e1, const vector_expression<E2> &e2) {
  684. typedef typename promote_traits<typename E1::value_type,
  685. typename E2::value_type>::promote_type value_type;
  686. typedef typename type_traits<value_type>::real_type real_type;
  687. return norm_inf (e1 - e2) == real_type/*zero*/();
  688. }
  689. template<class E1, class E2>
  690. bool
  691. operator == (const matrix_expression<E1> &e1, const matrix_expression<E2> &e2) {
  692. typedef typename promote_traits<typename E1::value_type,
  693. typename E2::value_type>::promote_type value_type;
  694. typedef typename type_traits<value_type>::real_type real_type;
  695. return norm_inf (e1 - e2) == real_type/*zero*/();
  696. }
  697. template<class T>
  698. struct AdditiveAbelianGroupConcept {
  699. typedef T value_type;
  700. void constraints () {
  701. bool r;
  702. value_type a = value_type (), b = value_type (), c = value_type ();
  703. r = (a + b) + c == a + (b + c);
  704. r = ZeroElement (value_type ()) + a == a;
  705. r = a + ZeroElement (value_type ()) == a;
  706. r = a + (- a) == ZeroElement (value_type ());
  707. r = (- a) + a == ZeroElement (value_type ());
  708. r = a + b == b + a;
  709. ignore_unused_variable_warning (r);
  710. }
  711. };
  712. template<class T>
  713. struct MultiplicativeAbelianGroupConcept {
  714. typedef T value_type;
  715. void constraints () {
  716. bool r;
  717. value_type a = value_type (), b = value_type (), c = value_type ();
  718. r = (a * b) * c == a * (b * c);
  719. r = OneElement (value_type ()) * a == a;
  720. r = a * OneElement (value_type ()) == a;
  721. r = a * (OneElement (value_type ()) / a) == a;
  722. r = (OneElement (value_type ()) / a) * a == a;
  723. r = a * b == b * a;
  724. ignore_unused_variable_warning (r);
  725. }
  726. };
  727. template<class T>
  728. struct RingWithIdentityConcept {
  729. typedef T value_type;
  730. void constraints () {
  731. function_requires< AdditiveAbelianGroupConcept<value_type> >();
  732. bool r;
  733. value_type a = value_type (), b = value_type (), c = value_type ();
  734. r = (a * b) * c == a * (b * c);
  735. r = (a + b) * c == a * c + b * c;
  736. r = OneElement (value_type ()) * a == a;
  737. r = a * OneElement (value_type ()) == a;
  738. ignore_unused_variable_warning (r);
  739. }
  740. };
  741. template<class T>
  742. struct Prod_RingWithIdentityConcept {
  743. typedef T value_type;
  744. void constraints () {
  745. function_requires< AdditiveAbelianGroupConcept<value_type> >();
  746. bool r;
  747. value_type a = value_type (), b = value_type (), c = value_type ();
  748. r = prod (T (prod (a, b)), c) == prod (a, T (prod (b, c)));
  749. r = prod (a + b, c) == prod (a, c) + prod (b, c);
  750. r = prod (OneElement (value_type ()), a) == a;
  751. r = prod (a, OneElement (value_type ())) == a;
  752. ignore_unused_variable_warning (r);
  753. }
  754. };
  755. template<class T>
  756. struct CommutativeRingWithIdentityConcept {
  757. typedef T value_type;
  758. void constraints () {
  759. function_requires< RingWithIdentityConcept<value_type> >();
  760. bool r;
  761. value_type a = value_type (), b = value_type ();
  762. r = a * b == b * a;
  763. ignore_unused_variable_warning (r);
  764. }
  765. };
  766. template<class T>
  767. struct FieldConcept {
  768. typedef T value_type;
  769. void constraints () {
  770. function_requires< CommutativeRingWithIdentityConcept<value_type> >();
  771. bool r;
  772. value_type a = value_type ();
  773. r = a == ZeroElement (value_type ()) || a * (OneElement (value_type ()) / a) == a;
  774. r = a == ZeroElement (value_type ()) || (OneElement (value_type ()) / a) * a == a;
  775. ignore_unused_variable_warning (r);
  776. }
  777. };
  778. template<class T, class V>
  779. struct VectorSpaceConcept {
  780. typedef T value_type;
  781. typedef V vector_type;
  782. void constraints () {
  783. function_requires< FieldConcept<value_type> >();
  784. function_requires< AdditiveAbelianGroupConcept<vector_type> >();
  785. bool r;
  786. value_type alpha = value_type (), beta = value_type ();
  787. vector_type a = vector_type (), b = vector_type ();
  788. r = alpha * (a + b) == alpha * a + alpha * b;
  789. r = (alpha + beta) * a == alpha * a + beta * a;
  790. r = (alpha * beta) * a == alpha * (beta * a);
  791. r = OneElement (value_type ()) * a == a;
  792. ignore_unused_variable_warning (r);
  793. }
  794. };
  795. template<class T, class V, class M>
  796. struct LinearOperatorConcept {
  797. typedef T value_type;
  798. typedef V vector_type;
  799. typedef M matrix_type;
  800. void constraints () {
  801. function_requires< VectorSpaceConcept<value_type, vector_type> >();
  802. bool r;
  803. value_type alpha = value_type (), beta = value_type ();
  804. vector_type a = vector_type (), b = vector_type ();
  805. matrix_type A = matrix_type ();
  806. r = prod (A, alpha * a + beta * b) == alpha * prod (A, a) + beta * prod (A, b);
  807. ignore_unused_variable_warning (r);
  808. }
  809. };
  810. void concept_checks () {
  811. // Allow tests to be group to keep down compiler storage requirement
  812. #ifdef INTERAL
  813. #define INTERNAL_STORAGE
  814. #define INTERNAL_VECTOR
  815. #define INTERNAL_MATRIX
  816. #define INTERNAL_SPECIAL
  817. #define INTERNAL_SPARSE
  818. #define INTERNAL_EXPRESSION
  819. #endif
  820. // TODO enable this for development
  821. // #define VIEW_CONCEPTS
  822. // Element value type for tests
  823. typedef float T;
  824. // Storage Array
  825. #if defined (INTERNAL_STORAGE) || defined (INTERNAL_STORAGE_DENSE)
  826. {
  827. typedef std::vector<T> container_model;
  828. function_requires< Mutable_StorageArrayConcept<container_model> >();
  829. function_requires< RandomAccessIteratorConcept<container_model::const_iterator> >();
  830. function_requires< Mutable_RandomAccessIteratorConcept<container_model::iterator> >();
  831. }
  832. {
  833. typedef bounded_array<T, 1> container_model;
  834. function_requires< Mutable_StorageArrayConcept<container_model> >();
  835. function_requires< RandomAccessIteratorConcept<container_model::const_iterator> >();
  836. function_requires< Mutable_RandomAccessIteratorConcept<container_model::iterator> >();
  837. }
  838. {
  839. typedef unbounded_array<T> container_model;
  840. function_requires< Mutable_StorageArrayConcept<container_model> >();
  841. function_requires< RandomAccessIteratorConcept<container_model::const_iterator> >();
  842. function_requires< Mutable_RandomAccessIteratorConcept<container_model::iterator> >();
  843. }
  844. /* FIXME array_adaptors are in progress
  845. {
  846. typedef array_adaptor<T> container_model;
  847. function_requires< Mutable_StorageArrayConcept<container_model> >();
  848. function_requires< RandomAccessIteratorConcept<container_model::const_iterator> >();
  849. function_requires< Mutable_RandomAccessIteratorConcept<container_model::iterator> >();
  850. }
  851. */
  852. {
  853. typedef range container_model;
  854. function_requires< IndexSetConcept<range> >();
  855. function_requires< RandomAccessIteratorConcept<range::const_iterator> >();
  856. }
  857. {
  858. typedef slice container_model;
  859. function_requires< IndexSetConcept<range> >();
  860. function_requires< RandomAccessIteratorConcept<range::const_iterator> >();
  861. }
  862. {
  863. typedef indirect_array<> container_model;
  864. function_requires< IndexSetConcept<range> >();
  865. function_requires< RandomAccessIteratorConcept<range::const_iterator> >();
  866. }
  867. #endif
  868. // Storage Sparse
  869. #if defined (INTERNAL_STORAGE) || defined (INTERNAL_STORAGE_SPARSE)
  870. {
  871. typedef map_array<std::size_t, T> container_model;
  872. function_requires< Mutable_StorageSparseConcept<container_model> >();
  873. function_requires< RandomAccessIteratorConcept<container_model::const_iterator> >();
  874. function_requires< RandomAccessIteratorConcept<container_model::iterator> >();
  875. }
  876. {
  877. typedef std::map<std::size_t, T> container_model;
  878. function_requires< Mutable_StorageSparseConcept<container_model > >();
  879. function_requires< BidirectionalIteratorConcept<container_model::const_iterator> >();
  880. function_requires< BidirectionalIteratorConcept<container_model::iterator> >();
  881. }
  882. #endif
  883. #ifdef VIEW_CONCEPTS
  884. // read only vectors
  885. {
  886. typedef vector_view<T> container_model;
  887. function_requires< RandomAccessContainerConcept<container_model> >();
  888. function_requires< VectorConcept<container_model> >();
  889. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  890. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  891. }
  892. #endif
  893. // Vector
  894. #if defined (INTERNAL_VECTOR) || defined (INTERNAL_VECTOR_DENSE)
  895. {
  896. typedef vector<T> container_model;
  897. function_requires< RandomAccessContainerConcept<container_model> >();
  898. function_requires< Mutable_VectorConcept<container_model> >();
  899. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  900. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  901. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  902. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  903. }
  904. {
  905. typedef zero_vector<T> container_model;
  906. function_requires< VectorConcept<container_model> >();
  907. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_iterator> >();
  908. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_reverse_iterator> >();
  909. }
  910. {
  911. typedef unit_vector<T> container_model;
  912. function_requires< VectorConcept<container_model> >();
  913. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_iterator> >();
  914. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_reverse_iterator> >();
  915. }
  916. {
  917. typedef scalar_vector<T> container_model;
  918. function_requires< VectorConcept<container_model> >();
  919. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  920. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  921. }
  922. {
  923. typedef c_vector<T, 1> container_model;
  924. function_requires< Mutable_VectorConcept<container_model> >();
  925. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  926. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  927. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  928. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  929. }
  930. #endif
  931. // Vector Proxies
  932. #if defined (INTERNAL_VECTOR) || defined (INTERNAL_VECTOR_PROXY)
  933. {
  934. typedef vector_range<vector<T> > container_model;
  935. function_requires< Mutable_VectorExpressionConcept<container_model> >();
  936. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  937. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  938. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  939. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  940. }
  941. {
  942. typedef vector_slice<vector<T> > container_model;
  943. function_requires< Mutable_VectorExpressionConcept<container_model> >();
  944. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  945. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  946. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  947. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  948. }
  949. {
  950. typedef vector_indirect<vector<T> > container_model;
  951. function_requires< Mutable_VectorExpressionConcept<container_model> >();
  952. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  953. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  954. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  955. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  956. }
  957. #endif
  958. // Sparse Vector
  959. #if defined (INTERNAL_SPARSE) || defined (INTERNAL_VECTOR_SPARSE)
  960. {
  961. typedef mapped_vector<T> container_model;
  962. function_requires< Mutable_SparseVectorConcept<container_model> >();
  963. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_iterator> >();
  964. function_requires< Mutable_IndexedBidirectional1DIteratorConcept<container_model::iterator> >();
  965. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_reverse_iterator> >();
  966. function_requires< Mutable_IndexedBidirectional1DIteratorConcept<container_model::reverse_iterator> >();
  967. }
  968. {
  969. typedef compressed_vector<T> container_model;
  970. function_requires< Mutable_SparseVectorConcept<container_model> >();
  971. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_iterator> >();
  972. function_requires< Mutable_IndexedBidirectional1DIteratorConcept<container_model::iterator> >();
  973. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_reverse_iterator> >();
  974. function_requires< Mutable_IndexedBidirectional1DIteratorConcept<container_model::reverse_iterator> >();
  975. }
  976. {
  977. typedef coordinate_vector<T> container_model;
  978. function_requires< Mutable_SparseVectorConcept<container_model> >();
  979. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_iterator> >();
  980. function_requires< Mutable_IndexedBidirectional1DIteratorConcept<container_model::iterator> >();
  981. function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_reverse_iterator> >();
  982. function_requires< Mutable_IndexedBidirectional1DIteratorConcept<container_model::reverse_iterator> >();
  983. }
  984. #endif
  985. // Matrix
  986. #if defined (INTERNAL_MATRIX) || defined (INTERNAL_MATRIX_DENSE)
  987. {
  988. typedef matrix<T> container_model;
  989. function_requires< Mutable_MatrixConcept<matrix<T> > >();
  990. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  991. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  992. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  993. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  994. }
  995. {
  996. typedef vector_of_vector<T> container_model;
  997. function_requires< Mutable_MatrixConcept<matrix<T> > >();
  998. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  999. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1000. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1001. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1002. }
  1003. {
  1004. typedef zero_matrix<T> container_model;
  1005. function_requires< Mutable_MatrixConcept<matrix<T> > >();
  1006. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1007. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1008. }
  1009. {
  1010. typedef identity_matrix<T> container_model;
  1011. function_requires< Mutable_MatrixConcept<matrix<T> > >();
  1012. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1013. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1014. }
  1015. {
  1016. typedef scalar_matrix<T> container_model;
  1017. function_requires< Mutable_MatrixConcept<matrix<T> > >();
  1018. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1019. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1020. }
  1021. {
  1022. typedef c_matrix<T, 1, 1> container_model;
  1023. function_requires< Mutable_MatrixConcept<matrix<T> > >();
  1024. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1025. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1026. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1027. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1028. }
  1029. #endif
  1030. // Matrix Proxies
  1031. #if defined (INTERNAL_MATRIX) || defined (INTERNAL_MATRIX_PROXY)
  1032. {
  1033. typedef matrix_row<matrix<T> > container_model;
  1034. function_requires< Mutable_VectorExpressionConcept<container_model> >();
  1035. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  1036. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  1037. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  1038. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  1039. }
  1040. {
  1041. typedef matrix_column<matrix<T> > container_model;
  1042. function_requires< Mutable_VectorExpressionConcept<container_model> >();
  1043. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  1044. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  1045. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  1046. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  1047. }
  1048. {
  1049. typedef matrix_vector_range<matrix<T> > container_model;
  1050. function_requires< Mutable_VectorExpressionConcept<container_model> >();
  1051. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  1052. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  1053. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  1054. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  1055. }
  1056. {
  1057. typedef matrix_vector_slice<matrix<T> > container_model;
  1058. function_requires< Mutable_VectorExpressionConcept<container_model> >();
  1059. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  1060. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  1061. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  1062. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  1063. }
  1064. {
  1065. typedef matrix_vector_indirect<matrix<T> > container_model;
  1066. function_requires< Mutable_VectorExpressionConcept<container_model> >();
  1067. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
  1068. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
  1069. function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
  1070. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
  1071. }
  1072. {
  1073. typedef matrix_range<matrix<T> > container_model;
  1074. function_requires< Mutable_MatrixExpressionConcept<container_model> >();
  1075. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1076. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1077. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1078. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1079. }
  1080. {
  1081. typedef matrix_slice<matrix<T> > container_model;
  1082. function_requires< Mutable_MatrixExpressionConcept<container_model> >();
  1083. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1084. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1085. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1086. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1087. }
  1088. {
  1089. typedef matrix_indirect<matrix<T> > container_model;
  1090. function_requires< Mutable_MatrixExpressionConcept<container_model> >();
  1091. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1092. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1093. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1094. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1095. }
  1096. #endif
  1097. // Banded Matrix
  1098. #if defined (INTERNAL_SPECIAL) || defined (INTERNAL_BANDED)
  1099. {
  1100. typedef banded_matrix<T> container_model;
  1101. function_requires< Mutable_MatrixConcept<container_model> >();
  1102. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1103. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1104. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1105. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1106. }
  1107. {
  1108. typedef banded_adaptor<matrix<T> > container_model;
  1109. function_requires< Mutable_MatrixExpressionConcept<container_model> >();
  1110. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1111. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1112. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1113. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1114. }
  1115. #endif
  1116. // Triangular Matrix
  1117. #if defined (INTERNAL_SPECIAL) || defined (INTERNAL_TRIANGULAR)
  1118. {
  1119. typedef triangular_matrix<T> container_model;
  1120. function_requires< Mutable_MatrixConcept<container_model> >();
  1121. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1122. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1123. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1124. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1125. }
  1126. {
  1127. typedef triangular_adaptor<matrix<T> > container_model;
  1128. function_requires< Mutable_MatrixExpressionConcept<container_model> >();
  1129. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1130. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1131. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1132. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1133. }
  1134. #endif
  1135. // Symmetric Matrix
  1136. #if defined (INTERNA_SPECIAL) || defined (INTERNAL_SYMMETRIC)
  1137. {
  1138. typedef symmetric_matrix<T> container_model;
  1139. function_requires< Mutable_MatrixConcept<container_model> >();
  1140. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1141. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1142. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1143. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1144. }
  1145. {
  1146. typedef banded_adaptor<matrix<T> > container_model;
  1147. #ifndef SKIP_BAD
  1148. // const_iterator (iterator) constructor is bad
  1149. function_requires< Mutable_MatrixExpressionConcept<container_model> >();
  1150. #endif
  1151. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1152. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1153. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1154. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1155. }
  1156. #endif
  1157. // Hermitian Matrix
  1158. #if defined (INTERNAL_SPECIAL) || defined (INTERNAL_HERMITIAN)
  1159. {
  1160. typedef hermitian_matrix<T> container_model;
  1161. function_requires< Mutable_MatrixConcept<container_model> >();
  1162. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1163. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1164. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1165. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1166. }
  1167. {
  1168. typedef hermitian_adaptor<matrix<T> > container_model;
  1169. #ifndef SKIP_BAD
  1170. // const_iterator (iterator) constructor is bad
  1171. function_requires< Mutable_MatrixExpressionConcept<container_model> >();
  1172. #endif
  1173. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1174. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1175. function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1176. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1177. }
  1178. #endif
  1179. // Sparse Matrix
  1180. #if defined (INTERNAL_SPARSE) || defined (INTERNAL_MATRIX_SPARSE)
  1181. {
  1182. typedef mapped_matrix<T> container_model;
  1183. function_requires< Mutable_SparseMatrixConcept<container_model> >();
  1184. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1185. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1186. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1187. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1188. }
  1189. {
  1190. typedef mapped_vector_of_mapped_vector<T> container_model;
  1191. function_requires< Mutable_SparseMatrixConcept<container_model> >();
  1192. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1193. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1194. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1195. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1196. }
  1197. {
  1198. typedef compressed_matrix<T> container_model;
  1199. function_requires< Mutable_SparseMatrixConcept<container_model> >();
  1200. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1201. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1202. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1203. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1204. }
  1205. {
  1206. typedef coordinate_matrix<T> container_model;
  1207. function_requires< Mutable_SparseMatrixConcept<container_model> >();
  1208. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1209. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1210. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1211. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1212. }
  1213. {
  1214. typedef generalized_vector_of_vector<T, row_major, vector< coordinate_vector<T> > > container_model;
  1215. function_requires< Mutable_SparseMatrixConcept<container_model> >();
  1216. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
  1217. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
  1218. function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
  1219. function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
  1220. }
  1221. #endif
  1222. // Scalar Expressions
  1223. #if defined (INTERNAL_EXPRESSION) || defined (INTERNAL_VECTOR_EXPRESSION)
  1224. function_requires< ScalarExpressionConcept<scalar_value<T> > >();
  1225. function_requires< ScalarExpressionConcept<scalar_reference<T> > >();
  1226. // Vector Expressions
  1227. {
  1228. typedef vector_reference<vector<T> > expression_model;
  1229. function_requires< VectorExpressionConcept<expression_model> >();
  1230. function_requires< Mutable_VectorExpressionConcept<expression_model> >();
  1231. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
  1232. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<expression_model::iterator> >();
  1233. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
  1234. function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<expression_model::reverse_iterator> >();
  1235. }
  1236. {
  1237. typedef vector_unary<vector<T>, scalar_identity<T> > expression_model;
  1238. function_requires< VectorExpressionConcept<expression_model> >();
  1239. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
  1240. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
  1241. }
  1242. {
  1243. typedef vector_binary<vector<T>, vector<T>, scalar_plus<T, T> > expression_model;
  1244. function_requires< VectorExpressionConcept<expression_model> >();
  1245. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
  1246. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
  1247. }
  1248. {
  1249. typedef vector_binary_scalar1<T, vector<T>, scalar_multiplies<T, T> > expression_model;
  1250. function_requires< VectorExpressionConcept<expression_model> >();
  1251. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
  1252. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
  1253. }
  1254. {
  1255. typedef vector_binary_scalar2<vector<T>, scalar_value<T>, scalar_multiplies<T, T> > expression_model;
  1256. function_requires< VectorExpressionConcept<expression_model> >();
  1257. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
  1258. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
  1259. }
  1260. {
  1261. typedef vector_binary_scalar1<scalar_value<T>, vector<T>, scalar_multiplies<T, T> > expression_model;
  1262. function_requires< VectorExpressionConcept<expression_model> >();
  1263. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
  1264. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
  1265. }
  1266. {
  1267. typedef vector_binary_scalar2<vector<T>, scalar_value<T>, scalar_multiplies<T, T> > expression_model;
  1268. function_requires< VectorExpressionConcept<expression_model> >();
  1269. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
  1270. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
  1271. }
  1272. function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_sum<vector<T> > > > >();
  1273. function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_norm_1<vector<T> > > > >();
  1274. function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_norm_2<vector<T> > > > >();
  1275. function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_norm_inf<vector<T> > > > >();
  1276. function_requires< ScalarExpressionConcept<vector_scalar_binary<vector<T>, vector<T>, vector_inner_prod<vector<T>, vector<T>, T> > > >();
  1277. #endif
  1278. // Matrix Expressions
  1279. #if defined (INTERNAL_EXPRESSION) || defined (INTERNAL_MATRIX_EXPRESSION)
  1280. {
  1281. typedef matrix_reference<matrix<T> > expression_model;
  1282. function_requires< MatrixExpressionConcept<expression_model> >();
  1283. function_requires< Mutable_MatrixExpressionConcept<expression_model> >();
  1284. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1285. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<expression_model::iterator1, expression_model::iterator2> >();
  1286. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1287. function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<expression_model::reverse_iterator1, expression_model::reverse_iterator2> >();
  1288. }
  1289. {
  1290. typedef vector_matrix_binary<vector<T>, vector<T>, scalar_multiplies<T, T> > expression_model;
  1291. function_requires< MatrixExpressionConcept<expression_model> >();
  1292. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1293. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1294. }
  1295. {
  1296. typedef matrix_unary1<matrix<T>, scalar_identity<T> > expression_model;
  1297. function_requires< MatrixExpressionConcept<expression_model> >();
  1298. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1299. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1300. }
  1301. {
  1302. typedef matrix_unary2<matrix<T>, scalar_identity<T> > expression_model;
  1303. function_requires< MatrixExpressionConcept<expression_model> >();
  1304. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1305. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1306. }
  1307. {
  1308. typedef matrix_binary<matrix<T>, matrix<T>, scalar_plus<T, T> > expression_model;
  1309. function_requires< MatrixExpressionConcept<expression_model> >();
  1310. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1311. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1312. }
  1313. {
  1314. typedef matrix_binary_scalar1<T, matrix<T>, scalar_multiplies<T, T> > expression_model;
  1315. function_requires< MatrixExpressionConcept<expression_model> >();
  1316. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1317. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1318. }
  1319. {
  1320. typedef matrix_binary_scalar2<matrix<T>, T, scalar_multiplies<T, T> > expression_model;
  1321. function_requires< MatrixExpressionConcept<expression_model> >();
  1322. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1323. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1324. }
  1325. {
  1326. typedef matrix_binary_scalar1<scalar_value<T>, matrix<T>, scalar_multiplies<T, T> > expression_model;
  1327. function_requires< MatrixExpressionConcept<expression_model> >();
  1328. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1329. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1330. }
  1331. {
  1332. typedef matrix_binary_scalar2<matrix<T>, scalar_value<T>, scalar_multiplies<T, T> > expression_model;
  1333. function_requires< MatrixExpressionConcept<expression_model> >();
  1334. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1335. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1336. }
  1337. {
  1338. typedef matrix_vector_binary1<matrix<T>, vector<T>, matrix_vector_prod1<matrix<T>, vector<T>, T> > expression_model;
  1339. function_requires< VectorExpressionConcept<expression_model> >();
  1340. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
  1341. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
  1342. }
  1343. {
  1344. typedef matrix_vector_binary2<vector<T>, matrix<T>, matrix_vector_prod2<matrix<T>, vector<T>, T > > expression_model;
  1345. function_requires< VectorExpressionConcept<expression_model> >();
  1346. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
  1347. function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
  1348. }
  1349. {
  1350. typedef matrix_matrix_binary<matrix<T>, matrix<T>, matrix_matrix_prod<matrix<T>, matrix<T>, T > > expression_model;
  1351. function_requires< MatrixExpressionConcept<expression_model> >();
  1352. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
  1353. function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
  1354. }
  1355. function_requires< ScalarExpressionConcept<matrix_scalar_unary<matrix<T>, matrix_norm_1<vector<T> > > > >();
  1356. function_requires< ScalarExpressionConcept<matrix_scalar_unary<matrix<T>, matrix_norm_frobenius<vector<T> > > > >();
  1357. function_requires< ScalarExpressionConcept<matrix_scalar_unary<matrix<T>, matrix_norm_inf<vector<T> > > > >();
  1358. #endif
  1359. #ifdef EXTERNAL
  1360. function_requires< AdditiveAbelianGroupConcept<float> >();
  1361. function_requires< CommutativeRingWithIdentityConcept<float> >();
  1362. function_requires< FieldConcept<float> >();
  1363. function_requires< VectorSpaceConcept<float, vector<float> > >();
  1364. function_requires< Prod_RingWithIdentityConcept<matrix<float> > >();
  1365. function_requires< VectorSpaceConcept<float, matrix<float> > >();
  1366. function_requires< LinearOperatorConcept<float, vector<float>, matrix<float> > >();
  1367. function_requires< AdditiveAbelianGroupConcept<std::complex<float> > >();
  1368. function_requires< CommutativeRingWithIdentityConcept<std::complex<float> > >();
  1369. function_requires< FieldConcept<std::complex<float> > >();
  1370. function_requires< VectorSpaceConcept<std::complex<float>, vector<std::complex<float> > > >();
  1371. function_requires< Prod_RingWithIdentityConcept<matrix<std::complex<float> > > >();
  1372. function_requires< VectorSpaceConcept<std::complex<float>, matrix<std::complex<float> > > >();
  1373. function_requires< LinearOperatorConcept<std::complex<float>, vector<std::complex<float> >, matrix<std::complex<float> > > >();
  1374. #endif
  1375. }
  1376. } // end of anonymous namespace
  1377. }}}
  1378. #endif