ady_1981 ([info]ady_1981) wrote,
@ 2009-06-03 15:29:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Кольца в Mathematica?...
Похоже в Mathematica не хватает структур типа кольца...
Списки - это хорошо. Но с кольцами некоторые вещи удобно было бы делать...



(4 comments) - (Post a new comment)


[info]beshenov
2009-06-03 11:41 am UTC (link)
А это что? Алгебраическая структура? Циклический список?

(Reply to this) (Thread)


[info]ady_1981
2009-06-03 12:49 pm UTC (link)
Да, циклический список.

(Reply to this) (Parent)(Thread)


[info]beshenov
2009-06-03 02:10 pm UTC (link)
Как-то так:

(define (cycle! list)
  (define (cycle-rec! rec)
    (if (null? (cdr rec))
	(set-cdr! rec list)
        (cycle-rec! (cdr rec))))
  (if (not (null? list))
      (cycle-rec! list)))

(define list '(a b c))

(cycle! list)

list => a b c a b c a b c ...


Ну и вообще работать с Maxima, в которой доступен Lisp.

(Reply to this) (Parent)(Thread)


[info]ady_1981
2009-06-03 03:02 pm UTC (link)
Так как такой объект не имеет точного одного представителя в элементарных Symbol"ах, то с ним нужно еще знать как работать...

Да, можно сделать чего-то подобное и обрезать там, где нужно.

(Reply to this) (Parent)


(4 comments) - (Post a new comment)

Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…