concepts.hpp 69 KB

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