1 страниц (19 вхождений)
Rounding Values in Vectors - User Function - Trying to make a function that rounds values in vectors - Сообщения
#1 Опубликовано: 21.04.2022 14:07:51
Version: 0.99 (Build: 7921)
The rounding function concept for a vector seems to work fine, but I am having trouble with a function that works on a vector containing multiple vectors.
Any ideas on how to make this work?
![2022-04-21 13_02_27-SMath Solver - [Rounding Values in Vectors Function Concepts.sm_].png](/ru-RU/file/wFdYH6/2022-04-21-13_02_27-SMath-Solver---_Rounding-Values-in-Vectors-Function-Concepts_sm___png)
![2022-04-21 13_03_06-SMath Solver - [Rounding Values in Vectors Function Concepts.sm_].png](/ru-RU/file/s3rr52/2022-04-21-13_03_06-SMath-Solver---_Rounding-Values-in-Vectors-Function-Concepts_sm___png)
Rounding Values in Vectors Function Concepts.sm (17 КиБ) скачан 30 раз(а).
The rounding function concept for a vector seems to work fine, but I am having trouble with a function that works on a vector containing multiple vectors.
Any ideas on how to make this work?
Rounding Values in Vectors Function Concepts.sm (17 КиБ) скачан 30 раз(а).
#2 Опубликовано: 21.04.2022 14:35:30
WroteThe rounding function concept for a vector seems to work fine, but I am having trouble with a function that works on a vector containing multiple vectors.
Any ideas on how to make this work?
You can use recursive for that.
You have to also check if rounded row is a vector.
It can work with both vector and nested vector.
Here is your code revised.
Regards
PS: MarB's solution with Razonar's addition is better actually.
I would use that instead of mine, more elegant.
My version is just a brute algorithm.
rounding_matrices.sm (10 КиБ) скачан 38 раз(а).
#3 Опубликовано: 21.04.2022 14:40:42
#4 Опубликовано: 21.04.2022 14:58:17
1 пользователям понравился этот пост
Wesly Centerwall 21.04.2022 15:16:00
#6 Опубликовано: 21.04.2022 15:13:35
Code revised to solve not just vectors but matrices too.
Now very complicated matrices can be rounded.
Regards
PS: MarB's solution with Razonar's addition is better actually.
I would use that instead of mine, more elegant.
My version is just a brute algorithm.
rounding_matrices.sm (10 КиБ) скачан 38 раз(а).

Now very complicated matrices can be rounded.
Regards
PS: MarB's solution with Razonar's addition is better actually.
I would use that instead of mine, more elegant.
My version is just a brute algorithm.
rounding_matrices.sm (10 КиБ) скачан 38 раз(а).
4 пользователям понравился этот пост
Wesly Centerwall 21.04.2022 15:16:00, NDTM Amarasekera 21.04.2022 15:41:00, sergio 21.04.2022 16:51:00, Alvaro Diaz Falconi 22.04.2022 11:15:00
#7 Опубликовано: 21.04.2022 15:16:07
Great ideas everyone, thanks for the input and improvements.
#8 Опубликовано: 21.04.2022 17:42:27
#9 Опубликовано: 21.04.2022 19:38:00
#10 Опубликовано: 21.04.2022 19:44:19
#11 Опубликовано: 22.04.2022 07:39:35
4 пользователям понравился этот пост
sergio 22.04.2022 08:09:00, Fridel Selitsky 22.04.2022 09:58:00, Alvaro Diaz Falconi 22.04.2022 11:15:00, overlord 22.04.2022 17:33:00
#12 Опубликовано: 22.04.2022 09:33:12
Up to this point, proposals round nested vectors.
Dealing with big numbers is also available.
123456789123456789 ... 987654321987654321
123000000000000000 typical
Dealing with big numbers is also available.
123456789123456789 ... 987654321987654321
123000000000000000 typical
#13 Опубликовано: 22.04.2022 09:44:08
WroteA very short way is to use recursion.
This is just magnificent. Two heads are better than one.
I couldn't hit off how to do it with vectorize.
Kudos
#14 Опубликовано: 22.04.2022 10:07:55
WroteA very short way is to use recursion:
Wonderful!
#15 Опубликовано: 22.04.2022 11:29:14
#16 Опубликовано: 22.04.2022 17:35:17
Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
2 пользователям понравился этот пост
#17 Опубликовано: 22.04.2022 19:36:17
#18 Опубликовано: 22.04.2022 20:56:06
WroteMinimalistic solution for Maximalists.
Sometimes I really wish I could use Maxima plugin under linux.
#19 Опубликовано: 23.04.2022 06:31:05
WroteWroteMinimalistic solution for Maximalists.
Sometimes I really wish I could use Maxima plugin under linux.
It is on my todo list and I think it is possible, but currently priority is on another project which also involves using Maxima and is entirely open source:
https://github.com/mkraska/meclib
Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 страниц (19 вхождений)
-
Новые сообщения
-
Нет новых сообщений