Re: [racket-users] Matrix Indexing Operations in "math/matrix"

2018-10-06 Thread Ricardo Iglesias
Sorry for the confusing wording. 
Basically, All I want is to be able to do 
G[ row ][ col ] = value

In Racket. I've been messing with Racket this afternoon and have an engine 
that is able to index into matrices, and just implemented several common 
matrix operations, such as transpose, matrix multiplication, etc..., so for 
now, I'm good. 


On Saturday, October 6, 2018 at 8:47:41 PM UTC-7, cwebber wrote:
>
> Ricardo Iglesias writes: 
>
> > Good afternoon. I'm trying to move away from things like Matlab and 
> SciPy 
> > to do linear algebra work. 
> > Something I notice I do a lot is indexing operations, such as 
> > MATRIX[ row ] [ column ] 
> > 
> > I'm looking at the "math/matrix" library provided here: 
> > https://docs.racket-lang.org/math/matrices.html, and don't see anything 
> of 
> > this sort; I only see things like 
> > (matrix-map-rows) 
> > 
> > and 
> > (matrix-map-cols) 
> > 
> > Being able to access and modify a particular entry in the matrix would 
> be 
> > very useful in specifying operations to matrices. For example, given a 
> > matrix *G*, one might want to perform indexing operations to get the 
> matrix 
> > attached. 
> > 
> > Is this possible with the math/matrix library? 
> > 
> > Additionally, would there be a way to implement a version of 
> > matrix-map-row/cols that uses an index? 
>
> Not quite what you're asking, but someone at RacketCon suggested to me 
> that maybe we should get GNU Scientific Library bindings added to 
> Racket, so we can better compete with Python and R for scientific / 
> statistical work... 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Matrix Indexing Operations in "math/matrix"

2018-10-06 Thread Christopher Lemmer Webber
Ricardo Iglesias writes:

> Good afternoon. I'm trying to move away from things like Matlab and SciPy 
> to do linear algebra work. 
> Something I notice I do a lot is indexing operations, such as 
> MATRIX[ row ] [ column ]
>
> I'm looking at the "math/matrix" library provided here: 
> https://docs.racket-lang.org/math/matrices.html, and don't see anything of 
> this sort; I only see things like 
> (matrix-map-rows) 
>
> and 
> (matrix-map-cols)
>
> Being able to access and modify a particular entry in the matrix would be 
> very useful in specifying operations to matrices. For example, given a 
> matrix *G*, one might want to perform indexing operations to get the matrix 
> attached. 
>
> Is this possible with the math/matrix library? 
>
> Additionally, would there be a way to implement a version of 
> matrix-map-row/cols that uses an index? 

Not quite what you're asking, but someone at RacketCon suggested to me
that maybe we should get GNU Scientific Library bindings added to
Racket, so we can better compete with Python and R for scientific /
statistical work...

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Making evaluators / handin server setup

2018-10-06 Thread Matthew Flatt
At Wed, 26 Sep 2018 15:57:12 -0700, Jordan Johnson wrote:
> > (require racket/sandbox)
> > (make-evaluator "beginner-lang.rkt")
> . . ../../../../../../../../Applications/Racket 
> v7.0/collects/racket/private/kw-file.rkt:102:2: open-input-file: `read' 
> access 
> denied for /Users/jteach/Library/Racket/7.0/pkgs/.LOCKpkgs.rktd

That was a problem with creating a sandbox in DrRacket, as opposed to
`racket` at the command line or with the handin server. It's fixed for
the next release.


> In doing a trial run of submitting my test solutions, I found my checker.rkt 
> signaling errors from the check: form: Using :language '(special 
> htdp-beginner), I get an error from the student’s (require 2htdp/image) line, 
> saying that image? is being imported twice.

Long story short, this appears to be a bug in the sandbox evaluator
setup, too, also fixed for the next release.

A workaround is to use `'lang/htdp-beginner` as the language instead of
`'(special beginner)`. That happens to avoid a redundant and
troublemaking `require`.

Roughly, the problem was that with `'(special beginner)` or `'(lib
"lang/htdp-beginner.rkt")` the sandbox constructs a module that uses
the language --- but also `require`s the language. That redundancy is a
problem if there are bindings that other `require`s are intended to
shadow, such as `image?` shadowed by requiring `2htdp/image`.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Matrix Indexing Operations in "math/matrix"

2018-10-06 Thread Ricardo Iglesias
Good afternoon. I'm trying to move away from things like Matlab and SciPy 
to do linear algebra work. 
Something I notice I do a lot is indexing operations, such as 
MATRIX[ row ] [ column ]

I'm looking at the "math/matrix" library provided here: 
https://docs.racket-lang.org/math/matrices.html, and don't see anything of 
this sort; I only see things like 
(matrix-map-rows) 

and 
(matrix-map-cols)

Being able to access and modify a particular entry in the matrix would be 
very useful in specifying operations to matrices. For example, given a 
matrix *G*, one might want to perform indexing operations to get the matrix 
attached. 

Is this possible with the math/matrix library? 

Additionally, would there be a way to implement a version of 
matrix-map-row/cols that uses an index? 

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Scribble warnings in package documentation

2018-10-06 Thread Matthew Flatt
Are you still seeing this problem? It looks like multiple problems,
possibly these:

 - `@defmodule[appy]` appearing in multiple sections

This one might be fixed by putting it once at a section that
encloses others, or maybe by using `#:link-target? #f` on all
but once of them.

 - function definitions in sections that are not within one that has
   `@defmodule[appy]`

   This one might also be fixed by moving `@defmodule[appy]` to an
   enclosing section, or maybe by just using
   `@declare-exporting[appy]`.

 -  Multiple sections titled "Overview".

This would be fixed by adding a `#:tag` to one or more of them to
make them distinct.

At Wed, 26 Sep 2018 16:09:56 +0100, Erich Rast wrote:
> I have a long package documentation and get lots of warnings - see
> below. Other than that, the docs work fine, should/can I ignore them? 
> 
> What do they mean anyway?
> 
> Best,
> 
> Erich
> 
> WARNING: collected information for key multiple times: '(exporting-libraries 
> #f); values: '(appy/gui) '(appy)
> WARNING: collected information for key multiple times: '(exporting-packages 
> #f); values: '("appy") '("appy")
> WARNING: collected information for key multiple times: '(exporting-libraries 
> #f); values: '(appy/storage-interface) '(appy/storage)
> WARNING: collected information for key multiple times: '(exporting-packages 
> #f); values: '("appy") '("appy")
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: no declared exporting libraries for definition
> WARNING: collected information for key multiple times: '(index-entry (part 
> "Overview")); values: (list '("Overview") (list (element #f '("Overview"))) 
> (part-index-desc)) (list '("Overview") (list (element #f '("Overview"))) 
> (part-index-desc))
> WARNING: collected information for key multiple times: '(part "Overview"); 
> values: '#(("Overview") (part "Overview") (1) (collects #"appy" 
> #"scribblings" 
> #"manual.html") #f) '#(("Overview") (part "Overview") (1 4 2) (collects 
> #"appy" #"scribblings" #"manual.html") #f)
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] raco config-path

2018-10-06 Thread Matthew Flatt
There's not currently a way to set that path dynamically. I'm not sure
what it would mean to call a Racket function to set that value, since
the configuration path is used to read the initial settings of various
parameters, such as `current-library-collection-paths`, that are needed
to boot Racket.

I think maybe you don't want to set `--config-path`, but you want to
instead want to store preferences in a different and separately
configured path. But I may misunderstand.

At Tue, 25 Sep 2018 11:45:01 -0700 (PDT), Lehi Toskin wrote:
> In the docs for raco exe, there exists a switch `--config-path` that you 
> can specify to tell the executable to look in this directory for a config 
> file. Is there a way to set this as a runtime path instead? When OS X runs 
> my test program, it'll have Cmd-, set as the default shortcut for opening 
> the preferences which appears to use the default "etc" directory, but I 
> don't yet see a way to make the path be set to any user's .config (or maybe 
> XDG) directory.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Places code not using all the CPU

2018-10-06 Thread George Neuner


On 10/5/2018 10:32 AM, Matthew Flatt wrote:
At Fri, 5 Oct 2018 15:36:04 +0200, Paulo Matos wrote: > Again, I am 
really surprised that you mention that places are not > separate 
processes. Documentation does say they are separate racket > virtual 
machines, how is this accomplished if not by using separate > 
processes? Each place is an OS thread within the Racket process. The 
virtual machine is essentially instantiated once in each thread, where 
things that look like global variables at the C level are actually 
thread-local variables to make them place-specific. Still, there is 
some sharing among the threads. > My workers are really doing Z3 style 
work - number crushing and lots of > searching. No IO (writing to 
disk) or communication so I would expect > them to really max out all 
CPUs. My best guess is that it's memory-allocation bottlenecks, 
probably at the point of using mmap() and mprotect(). Maybe things 
don't scale well beyond the 4-core machines that I use. On my 
machines, the enclosed program can max out CPU use with system time 
being a small fraction. It scales ok from 1 to 4 places (i.e., real 
time increased only some). The machine's core are hyperthreaded, and 
the example maxes out CPU utilization at 8 --- but it takes twice as 
long in real time, so the hardware threads don't help much in this 
case. Running two processes with 4 places takes about the same real 
time as running one process with 8 places, as does 2 processes with 2 
places. Do you see similar effects, or does this little example stop 
scaling before the number of processes matches the number of cores?


As Matthew said, this may be a case where multiple processes are better.

One thing that likely is vastly different between your two systems is 
the memory architecture.  On Paulo's many-core machine, each group of 
[probably] 6 CPUs will have its own physical bank of memory which is 
close to it and which it uses preferentially.  Access to a different 
bank may be very costly.  Paulo's machine may be spending a much greater 
percentage of time moving data between VM instances that are located in 
different memory regions ... something Matthew can't see on his quad-core.


Paulo, you might take a look at how memory is being allocated [not sure 
what tools you have for this] and see what happens if you restrict the 
process to running on various groups of CPUs.  It may be that some banks 
of your memory are "closer" than others.


Hope this helps,
George

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.