mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   PARI/GP (https://www.mersenneforum.org/forumdisplay.php?f=155)
-   -   PARI's commands (https://www.mersenneforum.org/showthread.php?t=13636)

science_man_88 2010-09-10 00:56

[QUOTE=CRGreathouse;229231]Yes, it *is* rather complex. But it's easier than the final project, and should be good practice. Also, you [i]could do it[/i] -- not that it would be easy, but with how far you've come I have no doubt.[/QUOTE]


I like how this can be used in DNA stuff I may use that part again lol

FaR was a change in mindset I saw this mentally:

[CENTER]Replacement
[TEX]\down[/TEX]
Start + Word_to Change + Finish
[TEX]\down[/TEX][/CENTER]


but really my code now does:


[CENTER]Repeat(up_to_Change + Replacement[TEX]\right[/TEX]Variable[TEX]\right[/TEX]print(variable))
print(up_to_change)[/CENTER]

science_man_88 2010-09-10 14:25

[QUOTE=CRGreathouse;229231]Yes, it *is* rather complex. But it's easier than the final project, and should be good practice. Also, you [i]could do it[/i] -- not that it would be easy, but with how far you've come I have no doubt.[/QUOTE]

I guessing looking for x spaces and reading it into c would help in one sense then knock off the first word and replace it with the next one.

science_man_88 2010-09-10 18:52

is there a way to shift Vec of Vec like vectors ? if so that may come in handy.

CRGreathouse 2010-09-10 19:53

[QUOTE=science_man_88;229322]is there a way to shift Vec of Vec like vectors ? if so that may come in handy.[/QUOTE]

You can make a vector of vectors, if you like... is that what you're asking?

science_man_88 2010-09-10 20:38

[QUOTE=CRGreathouse;229330]You can make a vector of vectors, if you like... is that what you're asking?[/QUOTE]

I know you can make Vec(Vec(),Vec())... but can you alter them by shifting like vectors can do ?

CRGreathouse 2010-09-10 21:49

Can you give an example?

science_man_88 2010-09-10 22:07

for example for a vector v you can use:

[CODE]v=vector(100,n,n);v=vector(#v-1,n,v[n+1])[/CODE]

to shift it by one.

is there an equivalent to this for Vec ?

CRGreathouse 2010-09-10 23:50

[QUOTE=science_man_88;229357]for example for a vector v you can use:

[CODE]v=vector(100,n,n);v=vector(#v-1,n,v[n+1])[/CODE]

to shift it by one.

is there an equivalent to this for Vec ?[/QUOTE]

??

It would be exactly the same.

science_man_88 2010-09-10 23:56

[QUOTE=CRGreathouse;229368]??

It would be exactly the same.[/QUOTE]

how'd you set up that Vec of Vec again ? I swear i saw you do it but I don't get it to work when i try it lol.

CRGreathouse 2010-09-11 04:39

Example 1:
[[1,2,3,4,5],[2,3,5,7,11]]

Example 2:
vector(5,n,vector(10,m,m^n))

science_man_88 2010-09-11 12:46

how will this help with Vec ?


All times are UTC. The time now is 23:15.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.