@@ -67,11 +67,10 @@ subview_elem1<eT,T1>::inplace_op(const eT val)
6767 const unwrap_check_mixed<T1> tmp (a.get_ref (), m_local);
6868 const umat& aa = tmp.M ;
6969
70- arma_conform_check
71- (
72- ( (aa.is_vec () == false ) && (aa.is_empty () == false ) ),
73- " Mat::elem(): given object must be a vector"
74- );
70+ if (resolves_to_vector<T1>::no)
71+ {
72+ arma_conform_check ( ( (aa.is_vec () == false ) && (aa.is_empty () == false ) ), " Mat::elem(): given object must be a vector" );
73+ }
7574
7675 const uword* aa_mem = aa.memptr ();
7776 const uword aa_n_elem = aa.n_elem ;
@@ -220,11 +219,10 @@ subview_elem1<eT,T1>::inplace_op(const Base<eT,T2>& x)
220219 const unwrap_check_mixed<T1> aa_tmp (a.get_ref (), m_local);
221220 const umat& aa = aa_tmp.M ;
222221
223- arma_conform_check
224- (
225- ( (aa.is_vec () == false ) && (aa.is_empty () == false ) ),
226- " Mat::elem(): given object must be a vector"
227- );
222+ if (resolves_to_vector<T1>::no)
223+ {
224+ arma_conform_check ( ( (aa.is_vec () == false ) && (aa.is_empty () == false ) ), " Mat::elem(): given object must be a vector" );
225+ }
228226
229227 const uword* aa_mem = aa.memptr ();
230228 const uword aa_n_elem = aa.n_elem ;
@@ -358,11 +356,10 @@ subview_elem1<eT,T1>::replace(const eT old_val, const eT new_val)
358356 const unwrap_check_mixed<T1> tmp (a.get_ref (), m_local);
359357 const umat& aa = tmp.M ;
360358
361- arma_conform_check
362- (
363- ( (aa.is_vec () == false ) && (aa.is_empty () == false ) ),
364- " Mat::elem(): given object must be a vector"
365- );
359+ if (resolves_to_vector<T1>::no)
360+ {
361+ arma_conform_check ( ( (aa.is_vec () == false ) && (aa.is_empty () == false ) ), " Mat::elem(): given object must be a vector" );
362+ }
366363
367364 const uword* aa_mem = aa.memptr ();
368365 const uword aa_n_elem = aa.n_elem ;
@@ -480,11 +477,10 @@ subview_elem1<eT,T1>::randu()
480477 const unwrap_check_mixed<T1> tmp (a.get_ref (), m_local);
481478 const umat& aa = tmp.M ;
482479
483- arma_conform_check
484- (
485- ( (aa.is_vec () == false ) && (aa.is_empty () == false ) ),
486- " Mat::elem(): given object must be a vector"
487- );
480+ if (resolves_to_vector<T1>::no)
481+ {
482+ arma_conform_check ( ( (aa.is_vec () == false ) && (aa.is_empty () == false ) ), " Mat::elem(): given object must be a vector" );
483+ }
488484
489485 const uword* aa_mem = aa.memptr ();
490486 const uword aa_n_elem = aa.n_elem ;
@@ -531,11 +527,10 @@ subview_elem1<eT,T1>::randn()
531527 const unwrap_check_mixed<T1> tmp (a.get_ref (), m_local);
532528 const umat& aa = tmp.M ;
533529
534- arma_conform_check
535- (
536- ( (aa.is_vec () == false ) && (aa.is_empty () == false ) ),
537- " Mat::elem(): given object must be a vector"
538- );
530+ if (resolves_to_vector<T1>::no)
531+ {
532+ arma_conform_check ( ( (aa.is_vec () == false ) && (aa.is_empty () == false ) ), " Mat::elem(): given object must be a vector" );
533+ }
539534
540535 const uword* aa_mem = aa.memptr ();
541536 const uword aa_n_elem = aa.n_elem ;
@@ -788,11 +783,10 @@ subview_elem1<eT,T1>::extract(Mat<eT>& actual_out, const subview_elem1<eT,T1>& i
788783 const unwrap_check_mixed<T1> tmp1 (in.a .get_ref (), actual_out);
789784 const umat& aa = tmp1.M ;
790785
791- arma_conform_check
792- (
793- ( (aa.is_vec () == false ) && (aa.is_empty () == false ) ),
794- " Mat::elem(): given object must be a vector"
795- );
786+ if (resolves_to_vector<T1>::no)
787+ {
788+ arma_conform_check ( ( (aa.is_vec () == false ) && (aa.is_empty () == false ) ), " Mat::elem(): given object must be a vector" );
789+ }
796790
797791 const uword* aa_mem = aa.memptr ();
798792 const uword aa_n_elem = aa.n_elem ;
@@ -854,11 +848,10 @@ subview_elem1<eT,T1>::mat_inplace_op(Mat<eT>& out, const subview_elem1& in)
854848 const unwrap<T1> tmp1 (in.a .get_ref ());
855849 const umat& aa = tmp1.M ;
856850
857- arma_conform_check
858- (
859- ( (aa.is_vec () == false ) && (aa.is_empty () == false ) ),
860- " Mat::elem(): given object must be a vector"
861- );
851+ if (resolves_to_vector<T1>::no)
852+ {
853+ arma_conform_check ( ( (aa.is_vec () == false ) && (aa.is_empty () == false ) ), " Mat::elem(): given object must be a vector" );
854+ }
862855
863856 const uword* aa_mem = aa.memptr ();
864857 const uword aa_n_elem = aa.n_elem ;
0 commit comments