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

Add function to create spoly from an array of numbers in radians #96

Merged
merged 1 commit into from
Nov 3, 2023

Conversation

esabol
Copy link
Contributor

@esabol esabol commented Oct 28, 2023

As discussed in issue #95, this pull request adds a constructor function to create an spoly from an array of numbers in radians. It is very similar to spoly_deg() except without the calls to deg_to_rad().

Question 1: Can the spoly(float8[]) function be marked PARALLEL SAFE? My reading of the documentation for PARALLEL SAFE doesn't mention anything about accessing arrays or allocating memory, so I think it should be.

Question 2: Can it be marked STRICT? select spoly(NULL::float8[]) returns null, I believe.

If the answer to either or both questions, I would like to make the same change(s) to spoly_deg also.

@df7cb
Copy link
Contributor

df7cb commented Oct 29, 2023

I believe the answer to both question is "yes".

Mind that besides the parameter being NULL, individual array elements might also be NULL.

src/polygon.c Outdated Show resolved Hide resolved
src/polygon.c Outdated Show resolved Hide resolved
src/polygon.c Outdated Show resolved Hide resolved
src/polygon.c Outdated Show resolved Hide resolved
src/polygon.c Show resolved Hide resolved
src/polygon.c Outdated Show resolved Hide resolved
src/polygon.c Outdated Show resolved Hide resolved
src/polygon.c Outdated Show resolved Hide resolved
expected/poly.out Outdated Show resolved Hide resolved
@vitcpp
Copy link
Contributor

vitcpp commented Oct 31, 2023

@esabol I think, everything ok except of some trivial formatting changes. Thank you!

@vitcpp
Copy link
Contributor

vitcpp commented Nov 1, 2023

@esabol I'm ok to accept the patch. Could you please squash the commits?

@esabol esabol force-pushed the add-spoly-array-constructor branch from 2cbb5b0 to 0fcfa36 Compare November 1, 2023 20:04
@esabol
Copy link
Contributor Author

esabol commented Nov 1, 2023

Rebased and squashed. Ready to merge whenever you are. Thank you for your reviews, @vitcpp !

@vitcpp
Copy link
Contributor

vitcpp commented Nov 3, 2023

It seems I'm the only reviewer. Lets merge it, since the risks to break the pgpshere are minimal.

@vitcpp vitcpp merged commit 81939cf into postgrespro:master Nov 3, 2023
15 checks passed
@esabol esabol deleted the add-spoly-array-constructor branch November 3, 2023 06:02
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

Successfully merging this pull request may close these issues.

3 participants