Hi, this is my first topic here and I want to know how do I make matrices in Ultra Fractal.

Thanks!

Hi, this is my first topic here and I want to know how do I make matrices in Ultra Fractal.
Thanks!

No posts to display

Hi, this is my first topic here and I want to know how do I make matrices in Ultra Fractal.

Thanks!

Hi, this is my first topic here and I want to know how do I make matrices in Ultra Fractal.
Thanks!

0

reply

Matrices are called arrays. See the help file for a brief description.

Matrices are called arrays. See the help file for a brief description.

0

reply

Matrices are called arrays. See the help file for a brief description.

I never thought of that before. Could be worth a try. Maybe an example with a two-variable Newton fractal could give me a template?

>Matrices are called arrays. See the help file for a brief description.
I never thought of that before. Could be worth a try. Maybe an example with a two-variable Newton fractal could give me a template?

0

reply

It's harder because there is no library of matrix manipulations, like matrix-vector multiplication or solving linear equations. I've mainly seen arrays used for remembering intermediate results for later use, such as

complex zsave[#maxiter+1]

...

zsave[i] = pz

...

And do something with the array at the end.

It's harder because there is no library of matrix manipulations, like matrix-vector multiplication or solving linear equations. I've mainly seen arrays used for remembering intermediate results for later use, such as
complex zsave[#maxiter+1]
...
zsave[i] = pz
...
And do something with the array at the end.

0

reply

Since the addition of functions/classes in UF5, it's possible for

someone to write a library of matrix/vector manipulation functions. So

this doesn't have to a built-in feature.

It turns out we can make a library of matrix/vector multiplication functions. So, where do I start?

While function declarations in formulas are useful, you cannot access them from another formula. To be able to re-use code in multiple formulas, you need to use classes instead.

A class is a declaration of a set of variables and functions that operate on these variables.

An object is an instance of its class. This class is the type of the object, just like int is the type of an integer variable.

The variables of a class are called fields.

The functions of a class are called methods. Both fields and methods are also known as the members of a class.

Classes are declared in formula files, or in plug-in library files with the .ulb file extension. A class looks a bit like a regular formula entry, but the entry identifier is preceded by the class keyword. Here is an example of a simple class that represents a point with integer coordinates:

```
class Point {
public:
func Point(int aX, int aY)
x = aX
y = aY
endfunc
float func distance(Point p)
; Returns the distance to the second point p.
return sqrt(sqr(p.x - x) + sqr(p.y - y))
endfunc
int x
int y
}
```

This class, named Point, contains a constructor, which is a special function that initializes an instance of the class. The constructor always has the same name as the class. Also, there is an additional method called distance, and two fields called x and y that store the coordinates of the point.

This could come in handy.

> Since the addition of functions/classes in UF5, it's possible for
someone to write a library of matrix/vector manipulation functions. So
this doesn't have to a built-in feature.
It turns out we can make a library of matrix/vector multiplication functions. So, where do I start?
> While function declarations in formulas are useful, you cannot access them from another formula. To be able to re-use code in multiple formulas, you need to use classes instead.
A class is a declaration of a set of variables and functions that operate on these variables.
An object is an instance of its class. This class is the type of the object, just like int is the type of an integer variable.
The variables of a class are called fields.
The functions of a class are called methods. Both fields and methods are also known as the members of a class.
Classes are declared in formula files, or in plug-in library files with the .ulb file extension. A class looks a bit like a regular formula entry, but the entry identifier is preceded by the class keyword. Here is an example of a simple class that represents a point with integer coordinates:
````
class Point {
public:
func Point(int aX, int aY)
x = aX
y = aY
endfunc
float func distance(Point p)
; Returns the distance to the second point p.
return sqrt(sqr(p.x - x) + sqr(p.y - y))
endfunc
int x
int y
}
````
> This class, named Point, contains a constructor, which is a special function that initializes an instance of the class. The constructor always has the same name as the class. Also, there is an additional method called distance, and two fields called x and y that store the coordinates of the point.
This could come in handy.

0

reply

Note that we already have a Vector class in the common.ulb file. If you were to add a matrix library (in your own ulb file), it would be handy to use that Vector class.

Note that we already have a Vector class in the common.ulb file. If you were to add a matrix library (in your own ulb file), it would be handy to use that Vector class.

Ultra Fractal author

1

reply

It's very difficult for me to code it, I don't have the knowledge to do it. Can someone else do it for me?

It's very difficult for me to code it, I don't have the knowledge to do it. Can someone else do it for me?

0

reply

What do you want to do with matrices? That will determine what to put in a matrix class.

What do you want to do with matrices? That will determine what to put in a matrix class.

0

reply

Eigenvalue algorithm fractals (i.e. the Rayleigh quotient iteration) and multidimensional Newton fractals for systems of nonlinear equations, for examples.

Eigenvalue algorithm fractals (i.e. the Rayleigh quotient iteration) and multidimensional Newton fractals for systems of nonlinear equations, for examples.

0

reply

Did you have any success in the linear algebra project? I am very interested in this. I need a basic linear equation solver in my projects, and also basic eigenvalue calculations.

Did you have any success in the linear algebra project? I am very interested in this. I need a basic linear equation solver in my projects, and also basic eigenvalue calculations.

0

reply

There is also Cramer's rule you can try, it is efficient, but it can be numerically unstable.

There is also Cramer's rule you can try, it is efficient, but it can be numerically unstable.

0

reply

Recently, I have learned that we can have array types. What if we could have more than just the integer, floating, boolean or complex data types? What if we could have also the long, double, BigInt and BigDecimal datatypes?

Recently, I have learned that we can have array types. What if we could have more than just the integer, floating, boolean or complex data types? What if we could have also the long, double, BigInt and BigDecimal datatypes?

0

reply

Wait a minute, do the array classes in the common.ulb file show similarities with the OpenGL Shading Language data types?!

Wait a minute, do the array classes in the common.ulb file show similarities with the OpenGL Shading Language data types?!

0

reply

I think any similarity with OpenGL shading data types is purely coincidental. Regarding long, double, etc: you don't need them. Float and complex cover all types of precision up to arbitrary. Depending on the precision selected by UF, float can be from 64-bit to huge numbers of decimals. Only int is always limited to 32-bit: use float if you need a larger range.

I think any similarity with OpenGL shading data types is purely coincidental. Regarding long, double, etc: you don't need them. Float and complex cover all types of precision up to arbitrary. Depending on the precision selected by UF, float can be from 64-bit to huge numbers of decimals. Only int is always limited to 32-bit: use float if you need a larger range.

Ultra Fractal author

0

reply

Speaking of, how does one create hexadecimals, doubles, bytes, chars, half precision floats, and char data types?

Speaking of, how does one create hexadecimals, doubles, bytes, chars, half precision floats, and char data types?

0

reply

You don't -- it's not really needed. Float precision is handled automatically.

https://www.ultrafractal.com/help/writing/language/types.html

You don't -- it's not really needed. Float precision is handled automatically.
https://www.ultrafractal.com/help/writing/language/types.html

Ultra Fractal author

0

reply

Suppose if I want to create my own integer types, where would I start? And how do I even create structure types? I also thought of even comparing derived classes to pointer types...

Additionally, are the compiler directives $define, $ifdef, $undef, among others, useful to define new operator symbols, or is there another way to create operator symbols, serving as a shorthand for the equivalent function operator? Furthermore, there should be a compiler directive $ifndef, I think it might help. Surely these compiler directives have more use than just version handling or debugging...

Such as for example:

$define CHAR_WIDTH 8

While I was away in Cuba, I looked at numerous documents surrounding the IEEE 754 and ISO/IEC C23 standards... I even also took a closer look at a few repositories on GitHub concerning minifloats. Maybe I could use some templates for these...

Suppose if I want to create my own integer types, where would I start? And how do I even create structure types? I also thought of even comparing derived classes to pointer types...
Additionally, are the compiler directives $define, $ifdef, $undef, among others, useful to define new operator symbols, or is there another way to create operator symbols, serving as a shorthand for the equivalent function operator? Furthermore, there should be a compiler directive $ifndef, I think it might help. Surely these compiler directives have more use than just version handling or debugging...
Such as for example:
$define CHAR_WIDTH 8
While I was away in Cuba, I looked at numerous documents surrounding the IEEE 754 and ISO/IEC C23 standards... I even also took a closer look at a few repositories on GitHub concerning minifloats. Maybe I could use some templates for these...

0

reply

The formula language is just not equal to C/C++ so $define doesn't have the preprocessing capabilities that #define in C has. It's only for conditional compilation.

I don't see a practical way to create your own integer type. And why would you? Just use float if the range of int is too small.

The formula language is just not equal to C/C++ so $define doesn't have the preprocessing capabilities that #define in C has. It's only for conditional compilation.
I don't see a practical way to create your own integer type. And why would you? Just use float if the range of int is too small.

Ultra Fractal author

0

reply

BTW, which programming language is Ultra Fractal's language closest to?

BTW, which programming language is Ultra Fractal's language closest to?

0

reply

I just want to practice, that is why.

I just want to practice, that is why.

0

reply

Your previous draft for topic is pending

If you continue, your previous draft will be discarded.

Cancel

Add

Cancel

Upload

All posts under this topic will be **deleted** ?

Cancel

Delete

Pending draft ... Click to resume editing

Discard draft