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

GCVSpline doesn't have any method to set errorVariance #3935

Open
mrrezaie opened this issue Oct 4, 2024 · 2 comments
Open

GCVSpline doesn't have any method to set errorVariance #3935

mrrezaie opened this issue Oct 4, 2024 · 2 comments

Comments

@mrrezaie
Copy link
Contributor

mrrezaie commented Oct 4, 2024

Hi, if I want to construct a GCVSpline() object, there isn't any method to set the errorVairance. I was wondering if you add the getErrorVariance and setErrorVariance methods for that. In this minimal example, the error variance remains zero as default (no smoothing):

GCVS = osim.GCVSpline()
GCVS.setDegree(5)
GCVS.addPoint(0.,1.)
print(GCVS.dump())
<GCVSpline>
    <half_order>3</half_order>
    <error_variance>0</error_variance>
    <x> 0</x>
    <y> 1</y>
    <weights> 1</weights>
    <coefficients> 0</coefficients>
</GCVSpline>

If I use GCVS.updPropertyByName('error_variance'), then how to change its value?

Also, it's not clear how to use this decorator in Python. What should be the aX and aF arguments?

Thank you in advance, and any help is greatly appreciated.

@nickbianco
Copy link
Member

@mrrezaie aX and aF take pointers to arrays, so this constructor likely doesn't work in scripting. It would be better to add scripting-friendly accessors as you suggest.

If you're interested in submitting a PR, I'd be happy to review.

@mrrezaie
Copy link
Contributor Author

I wish I could, but I know nothing about cpp; sorry.

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