You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It might be a good idea to decide on vector naming schemes. I think it would be important to have these schemes analog to what we settled on for matrices. Here are a few suggestions:
Rename namespace vector to multivector. Then rename Vector class to Dense in analogy with matrix objects. The class will be called as multivector::Dense, i.e. this convention would include that using namespace multivector is never invoked.
Alternatively, we could keep the namespace as vector and rename the class MultiDense, so the invocation of the type name would be vector::MultiDense. This name is a little bit cumbersome, but it also allows us to derive single vector from multivector class trivially and then have another type name vector::SingleDense. This may provide more flexibility.
Once we decide, it is straightforward to update names of classes and files.
The vector object should be called with both namespaces preceding it explicitly:
vector::dense::Multi vec;
This way, namespaces protect from name conflicts for vector classes and help code readability.
Alternatively, with this naming scheme we could take advantage of using statement like this:
using vector_type = vector::dense::Multi;
// some code
vector_type vec;
Here we define type vector_type that we want to use in this scope exclusively. We have a line that shows what vector_type is, and we use it as a short hand notation through the rest of the scope. If we change the first line, we are guaranteed to have a wholesale change within the entire scope.
On the other hand, using statements like this should be discouraged with this notation:
usingnamespacevector::dense;// 300 lines of code
Multi vec;
If we change using statement here, we still need to verify that each instance of Multi (1) exists in the new namespace and (2) is used correctly.
A single vector class can be derived from Multi vector almost trivially:
If we decide to implement e.g. our own matrix factorization, we will need a sparse vector object. In that case we could extend this naming scheme and define sparse vector class in different namespace like this:
It might be a good idea to decide on vector naming schemes. I think it would be important to have these schemes analog to what we settled on for matrices. Here are a few suggestions:
vector
tomultivector
. Then renameVector
class toDense
in analogy with matrix objects. The class will be called asmultivector::Dense
, i.e. this convention would include thatusing namespace multivector
is never invoked.vector
and rename the classMultiDense
, so the invocation of the type name would bevector::MultiDense
. This name is a little bit cumbersome, but it also allows us to derive single vector from multivector class trivially and then have another type namevector::SingleDense
. This may provide more flexibility.Once we decide, it is straightforward to update names of classes and files.
@kswirydo @cameronrutherford @rothpc please chime in.
The text was updated successfully, but these errors were encountered: