Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal of NON-signed LinkPoint access in FixedComp #72

Open
SAnsell opened this issue Sep 13, 2017 · 3 comments
Open

Removal of NON-signed LinkPoint access in FixedComp #72

SAnsell opened this issue Sep 13, 2017 · 3 comments

Comments

@SAnsell
Copy link
Owner

SAnsell commented Sep 13, 2017

The link points can be accessed from a FixedComp in many ways and this leads to inconsistencies.

The points can be accessed via

getSignedLinkPt( long int) ; 
getLinkPt(size_t) 

Axis via

getSignedLinkAxis( long int) ; 
getLinkAxs(size_t) 

and strings via

virtual std::string getSignedLinkString(const long int) const;

 std::string getLinkString(const size_t) const;
 std::string getLinkComplement(const size_t) const;
 std::string getBridgeComplement(const size_t) const;

 std::string getCommonString(const size_t) const;
 std::string getCommonComplement(const size_t) const;

 std::string getMasterString(const size_t) const;
 std::string getMasterComplement(const size_t) const;getLinkString(size_t )

ALL of the NON-Signed calls (taking size_t) are either going to be private OR deleted as soon as possible. Obviously if you are using the signed version you use the convention that sideIndex value of zero is the FixedComp origin, and 1 is the first link point, 2 the second etc , and -1 is the complement of the first link point (axis reversed). etc.

If you were using the old system, size_t sideIndex value of 0, was the first link point, 1, the second etc... This is now depreciated. Obviously as I do this process there is the possibility that errors creep in, please check your models and report or push a patch for any errors please.

I have carried out the first stage of this process removing

std::string getLinkString(const size_t) const;
 std::string getLinkComplement(const size_t) const;
 std::string getBridgeComplement(const size_t) const;

 std::string getCommonString(const size_t) const;
 std::string getCommonComplement(const size_t) const;

 std::string getMasterString(const size_t) const;
 std::string getMasterComplement(const size_t) const;

If there are any issues please

@kbat
Copy link
Collaborator

kbat commented Oct 25, 2017

What am I supposed to do instead of removed getSignedLinkComplement()?

@kbat
Copy link
Collaborator

kbat commented Oct 25, 2017

and instead of getBridgeComplement?

@SAnsell
Copy link
Owner Author

SAnsell commented Oct 26, 2017

Ok in principle that should be easy -- but if you have a difficult example please post it!

std::string getLinkString(const size_t)  const;
std::string getLinkComplement(const size_t)   const;

are both accessed via:

std::string getSignedLinkString(const long int index) const;

e.g.

std::string NormalRule=FC.getSignedLinkString(5); 
std::string NormalRule=FC.getLinkString(4);
std::string ComplementRule=FC.getSignedLinkString(-5);
std::string ComplementRule=FC.getLinkComplement(4);

Note the +1 that needs to be added to the signed rule.

Next we have getBridgeComplement:

Actually we also had

getSignedCommonRule(long int) which is the same as getBridgeRule(size_t) adn getBridgeComplement(size_t) in the same way. BUT due to the rarity of use I removed the std::string
version and left just the HeadRule version (which can obviously be moved to a string version with
getSignedCommonRule(5).display()

Note: that for performance issues we are keeping getLinkString(const size_t) const and
getLinkComplement(const size_t) const as private members of FixedComp, but current testMain run shows that replacing them in FixedComp is worth about 30% performance.

Anyone (a) unclear (b) has an edge case that this doesn't work well, (c) thinks I have made a design error -- Please add a comment -- many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants