My problem appears fixed now:
powSet=: /:~@:(<@#~) 2 (#"1~ +./)@#:@i...@^#
]e2 =: powSet M
+-+-+-+-+
| |a|a|b|
| | |b| |
+-+-+-+-+
$&.>e2
+---+---+---+---+
|0 1|1 1|2 1|1 1|
+---+---+---+---+
Thanks for including the sort in powSet, and for providing empties of the
correct shape.
Kip
Raul Miller wrote:
> On Tue, Aug 4, 2009 at 12:15 AM, david alis<[email protected]> wrote:
>> The expression ( (#"1) (+./) ) isn't correct.
>
> Oops,
>
> powSet=: /:~@:(<@#~) 2 (#"1~ +./)@#:@i...@^#
> powSet ;:'A B C'
> ++---+-----+-------+-----+---+-----+---+
> ||+-+|+-+-+|+-+-+-+|+-+-+|+-+|+-+-+|+-+|
> |||A|||A|B|||A|B|C|||A|C|||B|||B|C|||C||
> ||+-+|+-+-+|+-+-+-+|+-+-+|+-+|+-+-+|+-+|
> ++---+-----+-------+-----+---+-----+---+
>
> Sorry about that.
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm