Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • pyddg pyddg
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 190
    • Issues 190
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pyddg
  • pyddgpyddg
  • Merge requests
  • !465

Draft: Vectorize inputs of functions in euclidean.py

  • Review changes

  • Download
  • Patches
  • Plain diff
Closed Luka Rancic requested to merge euclidean-vectorized into develop Nov 04, 2022
  • Overview 2
  • Commits 3
  • Pipelines 3
  • Changes 1

Changed the input of circle_fct from float to numpy.ndarray. This allows to parameterize a whole array at once rather then a single point. This is useful, because otherwise you would need to generate a list or use numpy.fromfunction to get a whole circle.

Essentially that means you can do:

>>> t = np.linspace(0, 2*np.pi, 10, endpoint=False)
>>> circle_fct(t, (0,0,0), radius=1, normals=(0,0,1))
array([[ 1.00000000e+00,  0.00000000e+00,  0.00000000e+00],
       [ 8.09016994e-01,  5.87785252e-01,  0.00000000e+00],
       [ 3.09016994e-01,  9.51056516e-01,  0.00000000e+00],
       [-3.09016994e-01,  9.51056516e-01,  0.00000000e+00],
       [-8.09016994e-01,  5.87785252e-01,  0.00000000e+00],
       [-1.00000000e+00,  1.22464680e-16,  0.00000000e+00],
       [-8.09016994e-01, -5.87785252e-01,  0.00000000e+00],
       [-3.09016994e-01, -9.51056516e-01,  0.00000000e+00],
       [ 3.09016994e-01, -9.51056516e-01,  0.00000000e+00],
       [ 8.09016994e-01, -5.87785252e-01,  0.00000000e+00]])

This is a breaking change, no tests or similar have been changed to account for it yet, I just want to get some feedback for now. I personally don't see a single reason why not to do it this way. The motivation to make this change was because in math.geometric_objects.py the function circle_fct is used very ineffectively.

There are more function in math.euclidean.py that could be vectorized like this.

Edited Nov 05, 2022 by Luka Rancic
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: euclidean-vectorized