simplification

This commit is contained in:
conrad
2022-06-03 14:16:12 +10:00
parent 98309aa346
commit 39231f8d52
2 changed files with 8 additions and 16 deletions
+4 -8
View File
@@ -43,14 +43,10 @@ ones(const uword n_elem, const arma_empty_class junk1 = arma_empty_class(), cons
arma_ignore(junk1);
arma_ignore(junk2);
if(is_Row<obj_type>::value)
{
return Gen<obj_type, gen_ones>(1, n_elem);
}
else
{
return Gen<obj_type, gen_ones>(n_elem, 1);
}
const uword n_rows = (is_Row<obj_type>::value) ? uword(1) : n_elem;
const uword n_cols = (is_Row<obj_type>::value) ? n_elem : uword(1);
return Gen<obj_type, gen_ones>(n_rows, n_cols);
}
+4 -8
View File
@@ -43,14 +43,10 @@ zeros(const uword n_elem, const arma_empty_class junk1 = arma_empty_class(), con
arma_ignore(junk1);
arma_ignore(junk2);
if(is_Row<obj_type>::value)
{
return Gen<obj_type, gen_zeros>(1, n_elem);
}
else
{
return Gen<obj_type, gen_zeros>(n_elem, 1);
}
const uword n_rows = (is_Row<obj_type>::value) ? uword(1) : n_elem;
const uword n_cols = (is_Row<obj_type>::value) ? n_elem : uword(1);
return Gen<obj_type, gen_zeros>(n_rows, n_cols);
}