concepts.hpp 69 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466
  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